| java.lang.Object com.sun.midp.jadtool.Base64
Base64 | public class Base64 (Code) | | A class to do base64 encoding and decoding.
Base64 is a system for representing raw byte data as Ascii
characters. Each 3 input bytes will translate into 4
base64 digits. Each base64 digit is represented by an Ascii
character. This table shows how bytes are converted to
base64 digits.
base64 | | | | |
digits |6 5 4 3 2 1|6 5 4 3 2 1|6 5 4 3 2 1|6 5 4 3 2 1|
-------------------------------------------------
input |8 7 6 5 4 3 2 1|8 7 6 5 4 3 2 1|8 7 6 5 4 3 2 1|
bytes | | | |
Base64 encoding always extends the input data to a multiple
of 24 bits by padding with zeros.
Base64 is fully described in RFC 1521.
ftp://ds.internic.net/rfc/rfc1521.txt
Published in "Java Cryptography", 1998 by
O'Reilly & Associates.
|
Method Summary | |
public static byte[] | decode(String base64) decode
convert a base64 string into an array of bytes.
Parameters: base64 - A String of base64 digits to decode. | public static String | encode(byte[] raw) encode
coverts a byte array to a string populated with
base64 digits. | protected static char[] | encodeBlock(byte[] raw, int offset) | protected static char | getChar(int sixBit) | protected static int | getValue(char c) |
decode | public static byte[] decode(String base64)(Code) | | decode
convert a base64 string into an array of bytes.
Parameters: base64 - A String of base64 digits to decode. A byte array containing the decoded value ofthe base64 input string |
encode | public static String encode(byte[] raw)(Code) | | encode
coverts a byte array to a string populated with
base64 digits. It steps through the byte array
calling a helper method for each block of three
input bytes
Parameters: raw - The byte array to encode A string in base64 encoding |
encodeBlock | protected static char[] encodeBlock(byte[] raw, int offset)(Code) | | |
getChar | protected static char getChar(int sixBit)(Code) | | |
getValue | protected static int getValue(char c)(Code) | | |
|
|