|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.io.InputStream
|
+--net.rim.device.api.io.Base64InputStream
Input stream for reading Base64 encoded data.
This class implements a stream which reads in and decodes Base64 encoded data. For a description of the Base64 encoding scheme, see RFC 2045.
The input data is validated during decoding. Carriage return (0x0D) and line feed (0x0A) characters are ignored.
| Constructor Summary | ||
Base64InputStream(InputStream inputStream)
Constructs a new Base64InputStream instance with underlying input stream. |
||
Base64InputStream(InputStream inputStream,
boolean treatErrorAsEOF)
Constructs a new Base64InputStream instance with underlying input stream. |
||
| Method Summary | ||
int |
available()
Retrieves number of available bytes. |
|
void |
close()
Closes this input stream. |
|
static byte[] |
decode(byte[] input,
int inputOffset,
int inputLength)
Decode the Base64 encoded input and return the result. |
|
static byte[] |
decode(String input)
Decode the Base64 encoded input and return the result. |
|
static byte[] |
decode(String input,
int inputOffset,
int inputLength)
Decode the Base64 encoded input and return the result. |
|
int |
read()
Reads one byte from this stream. |
|
int |
read(byte[] buffer)
Reads some bytes from this stream. |
|
int |
read(byte[] buffer,
int bufferOffset,
int bufferLength)
Read specified number of bytes from this stream. |
|
| Methods inherited from class java.io.InputStream |
mark, markSupported, reset, skip |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Base64InputStream(InputStream inputStream)
inputStream - Underlying input stream.public Base64InputStream(InputStream inputStream, boolean treatErrorAsEOF)
inputStream - Underlying input stream.treatErrorAsEOF - A boolean to specify whether or not to treat a decoding error as the end of stream
or to just immediately throw an IOException.| Method Detail |
public int available()
throws IOException
Invoke this method to find out the number of bytes you can freely read (or skip over) from this stream (that is, without being blocked by another invocation of one of this stream's methods, on this or another thread).
available in class InputStreamIOException - If this stream is closed.
public void close()
throws IOException
Invoke this method to close this stream and release any system resources it uses.
close in class InputStreamIOException - If the underlying stream has a problem.
public static byte[] decode(byte[] input,
int inputOffset,
int inputLength)
throws IOException
input - The Base64 encoded inputinputOffset - The offset into the arrayinputLength - The length of the inputIOException - Thrown if a decoding error occurred.public static byte[] decode(String input) throws IOException
input - The Base64 encoded inputinputOffset - The offset into the arrayinputLength - The length of the inputIOException - Thrown if a decoding error occurred.public static byte[] decode(String input, int inputOffset, int inputLength) throws IOException
input - The Base64 encoded inputinputOffset - The offset into the arrayinputLength - The length of the inputIOException - Thrown if a decoding error occurred.
public int read()
throws IOException
Invoke this method to read one byte from this stream.
read in class InputStreamIOException - If this stream is closed, the underlying stream has a
problem, or the input data is corrupted.
public int read(byte[] buffer)
throws IOException
Invoke this method to attempt to fill a provided output parameter byte array with data from this stream.
read in class InputStreambuffer - Buffer to contain read and decoded data.IOException - If this stream is closed, the underlying stream has a
problem, or the input data is corrupted.
public int read(byte[] buffer,
int bufferOffset,
int bufferLength)
throws IOException
read in class InputStreambuffer - Buffer to contain data; must be large enough to contain
desired number of bytes.bufferOffset - First element in output parameter buffer at which to
begin writing decoded data; if not 0, then output parameter buffer must
be at least bufferOffset + bufferLength elements long.bufferLength - Number of bytes to read from this stream.IOException - If this stream is closed, the underlying stream has a
problem, or the input data is corrupted.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2008 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.