info.aduna.gee.publication.util
Class Base64InputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
info.aduna.gee.publication.util.AbstractByteFilterInputStream
info.aduna.gee.publication.util.Base64InputStream
- All Implemented Interfaces:
- Closeable
public class Base64InputStream
- extends AbstractByteFilterInputStream
Provides decoding of BASE64 encoded data as an input stream filter. The
underlying input stream is expected to be encoded in BASE64 form.
- Author:
- Joshua Davis
|
Method Summary |
static int |
parseCharacter(int ch)
Checks a character for correct BASE64 encoding. |
int |
read()
Reads the next byte of data from this input stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Base64InputStream
public Base64InputStream(InputStream in)
- Creates a new Base64 decoding input stream, using the input stream
(encoded stream).
- Parameters:
in - The base 64 encoded input stream
read
public int read()
throws IOException
- Reads the next byte of data from this input stream. The value
byte is returned as an
int in the range
0 to 255. If no byte is available
because the end of the stream has been reached, the value
-1 is returned. This method blocks until input data
is available, the end of the stream is detected, or an exception
is thrown.
This method
simply performs in.read() and returns the result.
- Specified by:
read in class AbstractByteFilterInputStream
- Returns:
- the next byte of data, or
-1 if the end of the
stream is reached.
- Throws:
IOException - if an I/O error occurs.- See Also:
FilterInputStream.in
parseCharacter
public static final int parseCharacter(int ch)
- Checks a character for correct BASE64 encoding. Returns -1 if the
character is not valid. Returns END_OF_INPUT if 'ch' is the end of
input character.
- Returns:
- int The binary value of the input character, or -1 if it is
not a valid BASE64 character.
Copyright © 1997-2008 Aduna. All Rights Reserved.