| java.lang.Object java.io.InputStream com.sun.perseus.util.Base64DecodeStream
Base64DecodeStream | public class Base64DecodeStream extends InputStream (Code) | | This class implements a Base64 Character decoder as specified in RFC1113.
Unlike some other encoding schemes there is nothing in this encoding that
tells the decoder where a buffer starts or stops, so to use it you will need
to isolate your encoded data into a single chunk and then feed them
this decoder. The simplest way to do that is to read all of the encoded
data into a string and then use:
byte data[];
InputStream is = new ByteArrayInputStream(data);
is = new Base64DecodeStream(is);
On errors, this class throws a IOException with the following detail
strings:
"Base64DecodeStream: Bad Padding byte (2)."
"Base64DecodeStream: Bad Padding byte (1)."
author: Thomas DeWeese author: Chuck McManis version: $Id: Base64DecodeStream.java,v 1.2 2006/04/21 06:35:45 st125089 Exp $ |
Method Summary | |
public int | available() | public void | close() Closes the stream. | final boolean | getNextAtom() | public int | read() | public int | read(byte[] out, int offset, int len) |
decodeBuffer | protected byte[] decodeBuffer(Code) | | Encoded data buffer
|
eof | protected boolean eof(Code) | | Controls whether the end of the input stream has been reached
|
outBuffer | protected byte[] outBuffer(Code) | | Output buffer
|
outOffset | protected int outOffset(Code) | | Offset in the out buffer
|
Base64DecodeStream | public Base64DecodeStream(InputStream src)(Code) | | Parameters: src - the Base64 encoded input stream |
close | public void close()(Code) | | Closes the stream. Note that this does not close
the associated InputStream
|
getNextAtom | final boolean getNextAtom() throws IOException(Code) | | true if the next atom has been read throws: IOException - if an I/O error happens |
read | public int read() throws IOException(Code) | | the next byte of data or -1 if the end of the stream is reached. throws: IOException - if an I/O error occurs. |
read | public int read(byte[] out, int offset, int len) throws IOException(Code) | | Parameters: out - where the decoded content should go Parameters: offset - in the out array Parameters: len - the number of atoms to read the number of atoms that were actually read throws: IOException - if an I/O error happens |
|
|