org.apache.geronimo.mail.util
Class QuotedPrintableEncoderStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by org.apache.geronimo.mail.util.QuotedPrintableEncoderStream
All Implemented Interfaces:
Closeable, Flushable

public class QuotedPrintableEncoderStream
extends FilterOutputStream

An implementation of a FilterOutputStream that encodes the stream data in Q-P encoding format. This version does the encoding "on the fly" rather than encoding a single block of data. Since this version is intended for use by the MimeUtilty class, it also handles line breaks in the encoded data.


Field Summary
protected static int DEFAULT_LINEBREAK
           
protected  QuotedPrintableEncoder encoder
           
protected  int lineBreak
           
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
QuotedPrintableEncoderStream(OutputStream out)
          Create a Base64 encoder stream that wraps a specifed stream using the default line break size.
QuotedPrintableEncoderStream(OutputStream out, int lineBreak)
           
 
Method Summary
 void close()
           
 void flush()
           
 void write(byte[] data)
           
 void write(byte[] data, int offset, int length)
           
 void write(int ch)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

encoder

protected QuotedPrintableEncoder encoder

DEFAULT_LINEBREAK

protected static final int DEFAULT_LINEBREAK
See Also:
Constant Field Values

lineBreak

protected int lineBreak
Constructor Detail

QuotedPrintableEncoderStream

public QuotedPrintableEncoderStream(OutputStream out)
Create a Base64 encoder stream that wraps a specifed stream using the default line break size.

Parameters:
out - The wrapped output stream.

QuotedPrintableEncoderStream

public QuotedPrintableEncoderStream(OutputStream out,
                                    int lineBreak)
Method Detail

write

public void write(int ch)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

write

public void write(byte[] data)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

write

public void write(byte[] data,
                  int offset,
                  int length)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class FilterOutputStream
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class FilterOutputStream
Throws:
IOException


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