org.apache.geronimo.mail.util
Class Base64DecoderStream

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

public class Base64DecoderStream
extends FilterInputStream

An implementation of a FilterInputStream that decodes the stream data in BASE64 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 static int BUFFERED_UNITS
           
protected  byte[] decodedChars
           
protected  int decodedCount
           
protected  int decodedIndex
           
protected  Base64Encoder decoder
           
protected  byte[] encodedChars
           
protected  boolean ignoreErrors
           
protected static String MAIL_BASE64_IGNOREERRORS
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
Base64DecoderStream(InputStream in)
           
 
Method Summary
 int available()
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] buffer, int offset, int length)
           
 
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

MAIL_BASE64_IGNOREERRORS

protected static final String MAIL_BASE64_IGNOREERRORS
See Also:
Constant Field Values

BUFFERED_UNITS

protected static final int BUFFERED_UNITS
See Also:
Constant Field Values

decoder

protected Base64Encoder decoder

ignoreErrors

protected boolean ignoreErrors

encodedChars

protected byte[] encodedChars

decodedChars

protected byte[] decodedChars

decodedCount

protected int decodedCount

decodedIndex

protected int decodedIndex
Constructor Detail

Base64DecoderStream

public Base64DecoderStream(InputStream in)
Method Detail

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-2009 The Apache Software Foundation. All Rights Reserved.