net.rim.device.api.io
Class Base64InputStream

This class implements a stream which reads in and decodes Base64 encoded
data. For a description of the Base64 encoding scheme, see RFC 2045. As per
RFC 2045, all input characters not in the Base64 character table are ignored.

// Decodes the given byte array from Base64.
// Offset and length specify which part of the array to decode.
// The decoded data is returned as a String.
public static String decodeBase64( byte[] toDecode, int offset, int
length )
{
// Create the input byte array to pass
in the content.
ByteArrayInputStream
byteArrayInputStream = new ByteArrayInputStream( toDecode, offset,
length )

Base64InputStream

Constructs a new Base64InputStream instance with underlying input stream. The stream defaults to immediately
throwing an IOException if a decoding error occurs, rather than treating the error as the EOF.

available

Invoke this method to find out the number of bytes you can freely
read (or skip over) from this stream (that is, without being blocked by
another invocation of one of this stream's methods, on this or another thread).