|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
com.tangosol.io.Base64InputStream
public class Base64InputStream
Reads binary data from a Reader using IETF RFC 2045 Base64 Content Transfer Encoding. Static helpers are available for decoding directly from a char array to a byte array.
Field Summary | |
---|---|
protected static byte[] |
EMPTY
Empty binary data. |
protected int[] |
m_abGroup
Group of bytes (stored as ints 0..255). |
protected boolean |
m_fClosed
True after close is invoked. |
protected boolean |
m_fEOF
True after eof is determined. |
protected int |
m_ofbGroup
The offset in the group of bytes. |
protected Reader |
m_reader
The Reader object from which the Base64 encoded data is read. |
Constructor Summary | |
---|---|
Base64InputStream(Reader reader)
Construct a Base64InputStream on a Reader object. |
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. |
void |
close()
Close the stream, flushing any accumulated bytes. |
static int |
decode(char ch)
Decode one base64 alphabet character. |
static byte[] |
decode(char[] ach)
Decode the passed character data that was encoded using Base64 encoding. |
static byte[] |
decode(char[] ach,
boolean fJunk)
Decode the passed character data that was encoded using Base64 encoding. |
static byte[] |
decode(char[] ach,
int of,
int cch)
Decode the passed character data that was encoded using Base64 encoding. |
static byte[] |
decode(char[] ach,
int of,
int cch,
boolean fJunk)
Decode the passed character data that was encoded using Base64 encoding. |
int |
read()
Reads the next byte of data from the input stream. |
Methods inherited from class java.io.InputStream |
---|
mark, markSupported, read, read, reset, skip |
Methods inherited from interface com.tangosol.io.InputStreaming |
---|
mark, markSupported, read, read, reset, skip |
Field Detail |
---|
protected static final byte[] EMPTY
protected boolean m_fClosed
protected boolean m_fEOF
protected Reader m_reader
protected int[] m_abGroup
protected int m_ofbGroup
Constructor Detail |
---|
public Base64InputStream(Reader reader)
reader
- the Reader to read the Base64 encoded data fromMethod Detail |
---|
public int read() throws IOException
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.
read
in interface InputStreaming
read
in class InputStream
-1
if the end of the
stream is reached.
IOException
- if an I/O error occurs.public int available() throws IOException
available
in interface InputStreaming
available
in class InputStream
IOException
- if an I/O error occurs.public void close() throws IOException
close
in interface InputStreaming
close
in interface Closeable
close
in class InputStream
IOException
- if an I/O error occurs.public static byte[] decode(char[] ach)
ach
- the array containing the characters to decode
public static byte[] decode(char[] ach, boolean fJunk)
ach
- the array containing the characters to decodefJunk
- true if the char array may contain whitespace or
linefeeds
public static byte[] decode(char[] ach, int of, int cch)
ach
- the array containing the characters to decodeof
- the start offset in the char arraycch
- the number of characters to decode
public static byte[] decode(char[] ach, int of, int cch, boolean fJunk)
ach
- the array containing the characters to decodeof
- the start offset in the char arraycch
- the number of characters to decodefJunk
- true if the char array may contain whitespace or
linefeeds
public static int decode(char ch)
ch
- the character
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |