Package com.sun.mail.imap
Class MessageLiteral
- java.lang.Object
-
- com.sun.mail.imap.MessageLiteral
-
- All Implemented Interfaces:
Literal
class MessageLiteral extends java.lang.Object implements Literal
An object that holds a Message object and reports its size and writes it to another OutputStream on demand. Used by appendMessages to avoid the need to buffer the entire message in memory in a single byte array before sending it to the server.
-
-
Constructor Summary
Constructors Constructor Description MessageLiteral(Message msg, int maxsize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
size()
Return the size of the data.void
writeTo(java.io.OutputStream os)
Write the data to the OutputStream.
-
-
-
Field Detail
-
msg
private Message msg
-
msgSize
private int msgSize
-
buf
private byte[] buf
-
-
Constructor Detail
-
MessageLiteral
public MessageLiteral(Message msg, int maxsize) throws MessagingException, java.io.IOException
- Throws:
MessagingException
java.io.IOException
-
-
Method Detail
-
size
public int size()
Description copied from interface:Literal
Return the size of the data.
-
-