gnu.mail.util

Class Base64InputStream


public class Base64InputStream
extends FilterInputStream

A Base64 content transfer encoding filter stream.

From RFC 2045, section 6.8:

The Base64 Content-Transfer-Encoding is designed to represent arbitrary sequences of octets in a form that need not be humanly readable. The encoding and decoding algorithms are simple, but the encoded data are consistently only about 33 percent larger than the unencoded data.

Constructor Summary

Base64InputStream(InputStream in)
Constructs an input stream that decodes an underlying Base64-encoded stream.

Method Summary

int
available()
Returns the number of bytes that can be read(or skipped over) from this input stream without blocking by the next caller of a method for this input stream.
int
read()
Reads the next byte of data from the input stream.
int
read(byte[] b, int off, int len)
Reads up to len bytes of data from the input stream into an array of bytes.

Constructor Details

Base64InputStream

public Base64InputStream(InputStream in)
Constructs an input stream that decodes an underlying Base64-encoded stream.

Parameters:
in - the Base64-encoded stream

Method Details

available

public int available()
            throws IOException
Returns the number of bytes that can be read(or skipped over) from this input stream without blocking by the next caller of a method for this input stream.


read

public int read()
            throws IOException
Reads the next byte of data from the input stream.


read

public int read(byte[] b,
                int off,
                int len)
            throws IOException
Reads up to len bytes of data from the input stream into an array of bytes.