Compoze Software, Inc.

com.compoze.util
Class Base64InputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended bycom.compoze.util.Base64InputStream

public class Base64InputStream
extends java.io.FilterInputStream

This class provides an implementation of a Base 64 decoder in the form of an extension of FilterOutputStream. It is based on the implementation of BASE64DecoderStream from Sun's JDK utility classes.


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
Base64InputStream(java.io.InputStream inputstream)
          Constructor.
 
Method Summary
 int available()
          Gets the number of bytes that are available to read.
 void decode()
          Decodes the buffer.
static byte[] decode(byte[] abyte0)
          Decodes a buffer.
 boolean markSupported()
          Determines if mark is supported.
 int read()
          Reads a byte.
 int read(byte[] abyte0, int i, int j)
          Reads bytes.
 
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
 

Constructor Detail

Base64InputStream

public Base64InputStream(java.io.InputStream inputstream)
Constructor.

Parameters:
inputstream - the underlying InputStream
Method Detail

read

public int read()
         throws java.io.IOException
Reads a byte.

Returns:
the byte that was read, or -1 if the end of the stream has been reached
Throws:
java.io.IOException - if an i/o error occurred

read

public int read(byte[] abyte0,
                int i,
                int j)
         throws java.io.IOException
Reads bytes.

Parameters:
abyte0 - the buffer to read into
i - the offset into the array
j - the length to read
Returns:
the number of bytes that were read, or -1 if the end of the stream has been reached
Throws:
java.io.IOException - if an i/o error occurred

markSupported

public boolean markSupported()
Determines if mark is supported. It's not.

Returns:
false

available

public int available()
              throws java.io.IOException
Gets the number of bytes that are available to read.

Throws:
java.io.IOException - if an i/o error occurred

decode

public void decode()
            throws java.io.IOException
Decodes the buffer.

Throws:
java.io.IOException - if an i/o error occurred

decode

public static byte[] decode(byte[] abyte0)
Decodes a buffer.


Compoze Software, Inc.

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.