Top Description Fields Constructors Methods
com.sun.mail.imap

pack-priv Class MessageLiteral

Located in compilation unit of com.sun.mail.imap.IMAPFolder.

extends Object
implements Literal
Class Inheritance
All Implemented Interfaces
com.sun.mail.iap.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.

Field Summary

Modifier and TypeField and Description
private byte[]
private Message
private int

Constructor Summary

AccessConstructor and Description
public
MessageLiteral(Message msg, int maxsize)

Method Summary

Modifier and TypeMethod and Description
public int
size()

Implements com.sun.mail.iap.Literal.size.

Return the size of the data.
public void
writeTo(OutputStream
the output stream
os
)

Implements com.sun.mail.iap.Literal.writeTo.

Write the data to the OutputStream.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufback to summary
private byte[] buf
msgback to summary
private Message msg
msgSizeback to summary
private int msgSize

Constructor Detail

MessageLiteralback to summary
public MessageLiteral(Message msg, int maxsize) throws MessagingException, IOException

Method Detail

sizeback to summary
public int size()

Implements com.sun.mail.iap.Literal.size.

Doc from com.sun.mail.iap.Literal.size.

Return the size of the data.

Returns:int

the size of the data

Annotations
@Override
writeToback to summary
public void writeTo(OutputStream os) throws IOException

Implements com.sun.mail.iap.Literal.writeTo.

Doc from com.sun.mail.iap.Literal.writeTo.

Write the data to the OutputStream.

Parameters
os:OutputStream

the output stream

Annotations
@Override
Exceptions
IOException:
for I/O errors