|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.codec.binary.Base64
This class provides encode/decode for RFC 2045 Base64 as defined by RFC 2045, N. Freed and N. Borenstein. RFC 2045: Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies. Reference 1996
Field Summary | |
private static byte[] |
base64Alphabet
|
(package private) static int |
BASELENGTH
|
(package private) static byte[] |
CHUNK_SEPARATOR
|
(package private) static int |
CHUNK_SIZE
|
(package private) static int |
EIGHTBIT
|
(package private) static int |
FOURBYTE
|
private static byte[] |
lookUpBase64Alphabet
|
(package private) static int |
LOOKUPLENGTH
|
(package private) static byte |
PAD
|
(package private) static int |
SIGN
|
(package private) static int |
SIXBIT
|
(package private) static int |
SIXTEENBIT
|
(package private) static int |
TWENTYFOURBITGROUP
|
Constructor Summary | |
Base64()
|
Method Summary | |
byte[] |
decode(byte[] pArray)
Decode a byte array and return the results of the decode as a byte array. |
java.lang.Object |
decode(java.lang.Object pObject)
Decode an "encoded" Object and return a "decoded" Object. |
static byte[] |
decodeBase64(byte[] base64Data)
Decodes Base64 data into octects |
(package private) static byte[] |
discardWhitespace(byte[] data)
Discards any whitespace from a base-64 encoded block. |
byte[] |
encode(byte[] pArray)
Encode a byte array and return the encoded data as a byte array. |
java.lang.Object |
encode(java.lang.Object pObject)
encode an Object |
static byte[] |
encodeBase64(byte[] binaryData)
|
static byte[] |
encodeBase64(byte[] binaryData,
boolean isChunked)
Encodes hex octects into Base64. |
static byte[] |
encodeBase64Chunked(byte[] binaryData)
|
static boolean |
isArrayByteBase64(byte[] arrayOctect)
|
private static boolean |
isBase64(byte octect)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final int CHUNK_SIZE
static final byte[] CHUNK_SEPARATOR
static final int BASELENGTH
static final int LOOKUPLENGTH
static final int TWENTYFOURBITGROUP
static final int EIGHTBIT
static final int SIXTEENBIT
static final int SIXBIT
static final int FOURBYTE
static final int SIGN
static final byte PAD
private static byte[] base64Alphabet
private static byte[] lookUpBase64Alphabet
Constructor Detail |
public Base64()
Method Detail |
private static boolean isBase64(byte octect)
public static boolean isArrayByteBase64(byte[] arrayOctect)
public static byte[] encodeBase64(byte[] binaryData)
public static byte[] encodeBase64Chunked(byte[] binaryData)
public java.lang.Object decode(java.lang.Object pObject) throws DecoderException
Decoder
decode
in interface Decoder
pObject
- an object to "decode"
DecoderException
- a decoder exception can
be thrown for any number of reasons. Some good
candidates are that the parameter passed to this
method is null, a param cannot be cast to the
appropriate type for a specific encoder.public byte[] decode(byte[] pArray) throws DecoderException
BinaryDecoder
decode
in interface BinaryDecoder
pArray
- A byte array which has been encoded with the
appropriate encoder
DecoderException
- A decoder exception is thrown
if a Decoder encounters a failure condition during
the decode process.public static byte[] encodeBase64(byte[] binaryData, boolean isChunked)
binaryData
- Array containing binary data to encode.
public static byte[] decodeBase64(byte[] base64Data)
static byte[] discardWhitespace(byte[] data)
data
- The base-64 encoded data to discard the whitespace
from.
public java.lang.Object encode(java.lang.Object pObject) throws EncoderException
encode
in interface Encoder
pObject
- An object ot encode
EncoderException
- an encoder exception is
thrown if the encoder experiences a failure
condition during the encoding process.public byte[] encode(byte[] pArray) throws EncoderException
BinaryEncoder
encode
in interface BinaryEncoder
pArray
- Data to be encoded
EncoderException
- thrown if the Encoder
encounters a failure condition during the
encoding process.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |