|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cryptix.util.mime.Base64
This class provides methods for encoding and decoding data in MIME base64 format.
The input to the encode
methods is always a byte array.
Strictly speaking the output represents a sequence of characters, but
since these characters are from a subset of both the Unicode and ASCII
character repertoires, it is possible to express the output either as
a String or as a byte array.
References:
Copyright © 1995-1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.1.1.1 $
Field Summary | |
protected static byte[] |
dec_table
A static array that maps ASCII code points to a 6-bit integer, or -1 for an invalid code point. |
protected static char[] |
enc_table
A static array that maps 6-bit integers to a specific char. |
Constructor Summary | |
Base64()
Creates a Base64 transfer-encoding object. |
Method Summary | |
byte[] |
decode(byte[] data)
Decodes a byte array containing base64-encoded ASCII. |
byte[] |
decode(java.lang.String msg)
Decodes a base64-encoded String. |
java.lang.String |
encode(byte[] data)
Encodes data as a String using base64 encoding. |
byte[] |
encodeAsByteArray(byte[] data)
Encodes data as a byte array using base64 encoding. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected static final char[] enc_table
protected static final byte[] dec_table
Constructor Detail |
public Base64()
Method Detail |
public java.lang.String encode(byte[] data)
public byte[] encodeAsByteArray(byte[] data)
public byte[] decode(byte[] data)
java.lang.IllegalArgumentException
- if data contains invalid characters,
i.e. not codes 0-32, 'A'-'Z', 'a'-'z', '+', '/'. or '=', or is
incorrectly padded.public byte[] decode(java.lang.String msg) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if data contains invalid characters,
i.e. not codes 0-32, 'A'-'Z', 'a'-'z', '+', '/'. or '=', or is
incorrectly padded.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |