org.apache.james.mailboxmanager
Interface MessageResult.Content

All Known Subinterfaces:
MessageResult.Header
Enclosing interface:
MessageResult

public static interface MessageResult.Content

IMAP needs to know the size of the content before it starts to write it out. This interface allows direct writing whilst exposing total size.


Method Summary
 long size()
          Size (in octets) of the content.
 void writeTo(java.lang.StringBuffer buffer)
          Writes content into the given buffer.
 void writeTo(java.nio.channels.WritableByteChannel channel)
          Writes content to the given channel.
 

Method Detail

writeTo

void writeTo(java.lang.StringBuffer buffer)
Writes content into the given buffer.

Parameters:
buffer - StringBuffer, not null
Throws:
javax.mail.MessagingException

writeTo

void writeTo(java.nio.channels.WritableByteChannel channel)
             throws java.io.IOException
Writes content to the given channel.

Parameters:
channel - Channel open, not null
Throws:
MailboxManagerException
java.io.IOException - when channel IO fails

size

long size()
Size (in octets) of the content.

Returns:
number of octets to be written
Throws:
javax.mail.MessagingException


Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.