org.apache.geronimo.mail.util
Class UUDecoderStream

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

public class UUDecoderStream
extends FilterInputStream

An implementation of a FilterOutputStream that decodes the stream data in UU 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  boolean beginRead
           
protected  byte[] decodedChars
           
protected  int decodedCount
           
protected  int decodedIndex
           
protected  UUEncoder decoder
           
protected static int MAX_CHARS_PER_LINE
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
UUDecoderStream(InputStream in)
           
 
Method Summary
 int available()
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] buffer, int offset, int length)
           
protected  String readLine()
          Read a line of data.
 
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

MAX_CHARS_PER_LINE

protected static final int MAX_CHARS_PER_LINE
See Also:
Constant Field Values

decoder

protected UUEncoder decoder

decodedChars

protected byte[] decodedChars

decodedCount

protected int decodedCount

decodedIndex

protected int decodedIndex

beginRead

protected boolean beginRead
Constructor Detail

UUDecoderStream

public UUDecoderStream(InputStream in)
Method Detail

readLine

protected String readLine()
                   throws IOException
Read a line of data. Returns null if there is an EOF.

Returns:
The next line read from the stream. Returns null if we hit the end of the stream.
Throws:
IOException

read

public int read()
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

read

public int read(byte[] buffer,
                int offset,
                int length)
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

markSupported

public boolean markSupported()
Overrides:
markSupported in class FilterInputStream

available

public int available()
              throws IOException
Overrides:
available in class FilterInputStream
Throws:
IOException


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