Package org.acplt.oncrpc.web
Class Base64
- java.lang.Object
-
- org.acplt.oncrpc.web.Base64
-
public abstract class Base64 extends java.lang.ObjectThe abstractBase64class provides static methods to convert back and forth between binary and base64-encoded data.- Version:
- $Revision: 1.1.1.1 $ $Date: 2003/08/13 12:03:44 $ $State: Exp $ $Locker: $
- Author:
- Harald Albrecht
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]decodingBase64AlephbethMapping from base64 alphabet to binary 0-63.private static byte[]encodingBase64AlephbethMapping from binary 0-63 to base64 alphabet according to RFC 2045.
-
Constructor Summary
Constructors Constructor Description Base64()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intdecode(byte[] encodedData, int encodedOffset, int length, byte[] binaryData, int binaryOffset)Converts base64 encoded data into binary data.static intencode(byte[] binaryData, int binaryOffset, int length, byte[] encodedData, int encodedOffset)Converts binary data into base64 encoded data.
-
-
-
Field Detail
-
encodingBase64Alephbeth
private static final byte[] encodingBase64Alephbeth
Mapping from binary 0-63 to base64 alphabet according to RFC 2045. (Yes, I do know that the Hebrew alphabet has only 22 letters.)
-
decodingBase64Alephbeth
private static final byte[] decodingBase64Alephbeth
Mapping from base64 alphabet to binary 0-63.
-
-
Method Detail
-
encode
public static int encode(byte[] binaryData, int binaryOffset, int length, byte[] encodedData, int encodedOffset)Converts binary data into base64 encoded data.- Parameters:
binaryData- Binary data to be encoded.binaryOffset- Offset intobinaryDatawhere to the data to be encoded begins.length- Length of data to encode.encodedData- Buffer receiving base64 encoded data.encodedOffset- Offset intoencodedDatawhere the store base64 encoded data.- Returns:
- Length of encoded base64 data.
-
decode
public static int decode(byte[] encodedData, int encodedOffset, int length, byte[] binaryData, int binaryOffset)Converts base64 encoded data into binary data.- Parameters:
encodedData- Base64 encoded data.encodedOffset- Offset intoencodedDatawhere the base64 encoded data starts.length- Length of encoded data.binaryData- Decoded (binary) data.binaryOffset- Offset intobinaryDatawhere to store the decoded binary data.- Returns:
- Length of decoded binary data.
-
-