Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.msn.mail.utils
Class Base64InputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by net.java.sip.communicator.impl.protocol.msn.mail.utils.Base64InputStream
All Implemented Interfaces:
Closeable

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.

Author:
Chris Burdess

Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
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.
 
Methods inherited from class java.io.FilterInputStream
close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Base64InputStream

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

Parameters:
in - the Base64-encoded stream
Method Detail

read

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

Overrides:
read in class FilterInputStream
Throws:
IOException

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.

Overrides:
read in class FilterInputStream
Throws:
IOException

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.

Overrides:
available in class FilterInputStream
Throws:
IOException

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.