org.apache.james.mime4j.message
Class DefaultMessageWriter

java.lang.Object
  extended by org.apache.james.mime4j.message.DefaultMessageWriter
All Implemented Interfaces:
MessageWriter

public class DefaultMessageWriter
extends java.lang.Object
implements MessageWriter

Default implementation of MessageWriter.


Constructor Summary
DefaultMessageWriter()
          Protected constructor prevents direct instantiation.
 
Method Summary
protected  java.io.OutputStream encodeStream(java.io.OutputStream out, java.lang.String encoding, boolean binaryBody)
           
 void writeBody(Body body, java.io.OutputStream out)
          Write the specified Body to the specified OutputStream.
 void writeEntity(Entity entity, java.io.OutputStream out)
          Write the specified Entity to the specified OutputStream.
 void writeField(Field field, java.io.OutputStream out)
          Write the specified Field to the specified OutputStream.
 void writeHeader(Header header, java.io.OutputStream out)
          Write the specified Header to the specified OutputStream.
 void writeMessage(Message message, java.io.OutputStream out)
          Write the specified Message to the specified OutputStream.
 void writeMultipart(Multipart multipart, java.io.OutputStream out)
          Write the specified Multipart to the specified OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMessageWriter

public DefaultMessageWriter()
Protected constructor prevents direct instantiation.

Method Detail

writeBody

public void writeBody(Body body,
                      java.io.OutputStream out)
               throws java.io.IOException
Write the specified Body to the specified OutputStream.

Specified by:
writeBody in interface MessageWriter
Parameters:
body - the Body to write.
out - the OutputStream to write to.
Throws:
java.io.IOException - if an I/O error occurs.

writeEntity

public void writeEntity(Entity entity,
                        java.io.OutputStream out)
                 throws java.io.IOException
Write the specified Entity to the specified OutputStream.

Specified by:
writeEntity in interface MessageWriter
Parameters:
entity - the Entity to write.
out - the OutputStream to write to.
Throws:
java.io.IOException - if an I/O error occurs.

writeMessage

public void writeMessage(Message message,
                         java.io.OutputStream out)
                  throws java.io.IOException
Write the specified Message to the specified OutputStream.

Specified by:
writeMessage in interface MessageWriter
Parameters:
message - the Message to write.
out - the OutputStream to write to.
Throws:
java.io.IOException - if an I/O error occurs.

writeMultipart

public void writeMultipart(Multipart multipart,
                           java.io.OutputStream out)
                    throws java.io.IOException
Write the specified Multipart to the specified OutputStream.

Specified by:
writeMultipart in interface MessageWriter
Parameters:
multipart - the Multipart to write.
out - the OutputStream to write to.
Throws:
java.io.IOException - if an I/O error occurs.

writeField

public void writeField(Field field,
                       java.io.OutputStream out)
                throws java.io.IOException
Write the specified Field to the specified OutputStream.

Specified by:
writeField in interface MessageWriter
Parameters:
field - the Field to write.
out - the OutputStream to write to.
Throws:
java.io.IOException - if an I/O error occurs.

writeHeader

public void writeHeader(Header header,
                        java.io.OutputStream out)
                 throws java.io.IOException
Write the specified Header to the specified OutputStream.

Specified by:
writeHeader in interface MessageWriter
Parameters:
header - the Header to write.
out - the OutputStream to write to.
Throws:
java.io.IOException - if an I/O error occurs.

encodeStream

protected java.io.OutputStream encodeStream(java.io.OutputStream out,
                                            java.lang.String encoding,
                                            boolean binaryBody)
                                     throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.