|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.common.Base64InputStream
A class that supports Base64 encoding of data from a
java.io.InputStream
.
Field Summary | |
private static int |
BASE64_BUFFER_SIZE
|
private static java.lang.String |
COPYRIGHT_NOTICE
|
private static DAILogger |
LOG
|
private byte[] |
mBuffer
|
private byte[] |
mEncoded
|
private java.io.InputStream |
mInputStream
|
private boolean |
mStreamHasData
|
private int |
mStreamIndex
|
Constructor Summary | |
Base64InputStream(java.io.InputStream in)
Create a new Base64InputStream . |
Method Summary | |
int |
available()
Reads the available data from the InputStream and
encodes it. |
void |
close()
Close the InputStream and the
Base64InputStream . |
int |
read(byte[] b)
Read from the InputStream , Base64 encode the data
and insert it into the byte array. |
private void |
readAndEncode()
Read from the InputStream , Base64 encode the data
and store it locally. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private static DAILogger LOG
private static final int BASE64_BUFFER_SIZE
private java.io.InputStream mInputStream
private byte[] mBuffer
private byte[] mEncoded
private int mStreamIndex
private boolean mStreamHasData
Constructor Detail |
public Base64InputStream(java.io.InputStream in) throws OutOfMemoryException
Base64InputStream
.
Default capacity is 4096 * 3 bytes.
in
- InputStream
that is to be Base64 encoded.
OutOfMemoryException
- is there is
no memory available to create a buffer for the Base64 encoded
data.Method Detail |
public int available() throws java.io.IOException, OutOfMemoryException
InputStream
and
encodes it.
java.io.IOException
- if there is a problem in reading from the
InputStream
.
OutOfMemoryException
- is there is no memory available.InputStream.available()
public int read(byte[] b) throws java.io.IOException, OutOfMemoryException
InputStream
, Base64 encode the data
and insert it into the byte array.
b
- Byte array into which encoded data is to be inserted..
java.io.IOException
- if there is a problem in reading from the
InputStream
.
OutOfMemoryException
- is there is no memory available.InputStream.read(byte[])
private void readAndEncode() throws java.io.IOException, OutOfMemoryException
InputStream
, Base64 encode the data
and store it locally.
java.io.IOException
- if there is a problem in reading from the
InputStream
.
OutOfMemoryException
- is there is no memory available.public void close() throws java.io.IOException
InputStream
and the
Base64InputStream
.
java.io.IOException
- if there is a problem in closing the
InputStream
.InputStream.close()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |