|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.yajul.io.Base64Decoder
public class Base64Decoder
Decode a BASE64 encoded input stream to some output stream. This class implements BASE64 decoding, as specified in the MIME specification.
Base64Encoder
Constructor Summary | |
---|---|
Base64Decoder()
Default constructor. |
|
Base64Decoder(byte[] bytes,
int offset,
int length)
Creates a decoder that will decode the specified array of bytes. |
|
Base64Decoder(java.io.InputStream in,
java.io.OutputStream out)
Create a decoder to decode a stream. |
|
Base64Decoder(java.lang.String input)
Create a decoder to decode a String. |
Method Summary | |
---|---|
static byte[] |
decode(byte[] input)
Convenience method that will decode the given byte array. |
static byte[] |
decode(byte[] input,
int offset,
int length)
Convenience method that will decode the given byte array. |
static java.lang.String |
decode(java.lang.String input)
Convenience method that will decode the given string. |
void |
initialize(byte[] bytes,
int offset,
int length)
Initializes the decoder with an array of base 64 encoded bytes. |
void |
process()
Do the actual decoding. |
java.lang.String |
processString()
Do the decoding, and return a String. |
byte[] |
toByteArray()
Returns the byte array that is the result of the decoding the input array of bytes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Base64Decoder()
public Base64Decoder(java.io.InputStream in, java.io.OutputStream out)
in
- The input stream (to be decoded).out
- The output stream, to write decoded data to.public Base64Decoder(java.lang.String input)
input
- The string to be decoded.public Base64Decoder(byte[] bytes, int offset, int length)
bytes
- The array of bytes to be decoded.offset
- The offset in the buffer of the first byte to read.length
- The maximum number of bytes to read from the buffer.Method Detail |
---|
public static java.lang.String decode(java.lang.String input) throws Base64FormatException
input
- The input string
Base64FormatException
- if the input is not valid.public static byte[] decode(byte[] input) throws Base64FormatException
input
- The input byte array
Base64FormatException
- if the input is not valid.public static byte[] decode(byte[] input, int offset, int length) throws Base64FormatException
input
- The input byte arrayoffset
- The offset in the buffer of the first byte to read.length
- The maximum number of bytes to read from the buffer.
Base64FormatException
- if the input is not valid.public void initialize(byte[] bytes, int offset, int length)
bytes
- The array of bytes to be decoded.offset
- The offset in the buffer of the first byte to read.length
- The maximum number of bytes to read from the buffer.public void process() throws java.io.IOException
java.io.IOException
- If the input or output stream accesses failed.
Base64FormatException
- If the input stream is not compliant
with the BASE64 specification.public java.lang.String processString() throws Base64FormatException
Base64FormatException
- If the input string is not compliant
with the BASE64 specification.public byte[] toByteArray()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |