Package com.twelvemonkeys.io.enc
Class Base64Decoder
java.lang.Object
com.twelvemonkeys.io.enc.Base64Decoder
- All Implemented Interfaces:
Decoder
Decoder
implementation for standard base64 encoding.- Version:
- $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/enc/Base64Decoder.java#2 $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]
(package private) static final byte[]
This array maps the characters to their 6 bit values(package private) static final byte[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
decode
(InputStream stream, ByteBuffer buffer) Decodes up tobuffer.length
bytes from the given input stream, into the given buffer.protected boolean
decodeAtom
(InputStream pInput, ByteBuffer pOutput, int pLength) protected static int
readFully
(InputStream pStream, byte[] pBytes, int pOffset, int pLength)
-
Field Details
-
PEM_ARRAY
static final byte[] PEM_ARRAYThis array maps the characters to their 6 bit values -
PEM_CONVERT_ARRAY
static final byte[] PEM_CONVERT_ARRAY -
decodeBuffer
private byte[] decodeBuffer
-
-
Constructor Details
-
Base64Decoder
public Base64Decoder()
-
-
Method Details
-
readFully
protected static int readFully(InputStream pStream, byte[] pBytes, int pOffset, int pLength) throws IOException - Throws:
IOException
-
decodeAtom
protected boolean decodeAtom(InputStream pInput, ByteBuffer pOutput, int pLength) throws IOException - Throws:
IOException
-
decode
Description copied from interface:Decoder
Decodes up tobuffer.length
bytes from the given input stream, into the given buffer.- Specified by:
decode
in interfaceDecoder
- Parameters:
stream
- the input stream to decode data frombuffer
- buffer to store the read data- Returns:
- the total number of bytes read into the buffer, or
0
if there is no more data because the end of the stream has been reached. - Throws:
IOException
- if an I/O error occurs.
-