org.apache.geronimo.mail.util
Class QuotedPrintableDecoderStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by org.apache.geronimo.mail.util.QuotedPrintableDecoderStream
All Implemented Interfaces:
Closeable

public class QuotedPrintableDecoderStream
extends FilterInputStream

An implementation of a FilterOutputStream that decodes the stream data in Q-P encoding format. This version does the decoding "on the fly" rather than decoding 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  QuotedPrintableEncoder decoder
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
QuotedPrintableDecoderStream(InputStream in)
          Stream constructor.
 
Method Summary
 int available()
          Give an estimate of how much additional data is available from this stream.
 boolean markSupported()
          Indicate whether this stream supports the mark() operation.
 int read()
          Read a single byte from the stream.
 int read(byte[] buffer, int offset, int length)
          Read a buffer of data from the input stream.
 
Methods inherited from class java.io.FilterInputStream
close, mark, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

decoder

protected QuotedPrintableEncoder decoder
Constructor Detail

QuotedPrintableDecoderStream

public QuotedPrintableDecoderStream(InputStream in)
Stream constructor.

Parameters:
in - The InputStream this stream is filtering.
Method Detail

read

public int read()
         throws IOException
Read a single byte from the stream.

Overrides:
read in class FilterInputStream
Returns:
The next byte of the stream. Returns -1 for an EOF condition.
Throws:
IOException

read

public int read(byte[] buffer,
                int offset,
                int length)
         throws IOException
Read a buffer of data from the input stream.

Overrides:
read in class FilterInputStream
Parameters:
buffer - The target byte array the data is placed into.
offset - The starting offset for the read data.
length - How much data is requested.
Returns:
The number of bytes of data read.
Throws:
IOException

markSupported

public boolean markSupported()
Indicate whether this stream supports the mark() operation.

Overrides:
markSupported in class FilterInputStream
Returns:
Always returns false.

available

public int available()
              throws IOException
Give an estimate of how much additional data is available from this stream.

Overrides:
available in class FilterInputStream
Returns:
Always returns -1.
Throws:
IOException


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