| java.lang.Object org.apache.ojb.broker.util.Base64
Base64 | public class Base64 (Code) | | |
Field Summary | |
final public static boolean | DECODE Specify decoding (value is false). | final public static boolean | ENCODE Specify encoding (value is true). |
Method Summary | |
public static byte[] | decode(String s) Decodes data from Base64 notation. | public static byte[] | decode(byte[] source, int off, int len) Decodes Base64 content in byte array format and returns
the decoded byte array. | public static Object | decodeToObject(String encodedObject) Attempts to decode Base64 data and deserialize a Java
Object within. | public static String | decodeToString(String s) Decodes data from Base64 notation and
returns it as a string. | public static String | encodeBytes(byte[] source) Encodes a byte array into Base64 notation. | public static String | encodeBytes(byte[] source, boolean breakLines) Encodes a byte array into Base64 notation. | public static String | encodeBytes(byte[] source, int off, int len) Encodes a byte array into Base64 notation. | public static String | encodeBytes(byte[] source, int off, int len, boolean breakLines) Encodes a byte array into Base64 notation. | public static String | encodeObject(java.io.Serializable serializableObject) Serializes an object and returns the Base64-encoded
version of that serialized object. | public static String | encodeObject(java.io.Serializable serializableObject, boolean breakLines) Serializes an object and returns the Base64-encoded
version of that serialized object. | public static String | encodeString(String s) Encodes a string in Base64 notation with line breaks
after every 75 Base64 characters. | public static String | encodeString(String s, boolean breakLines) Encodes a string in Base64 notation with line breaks
after every 75 Base64 characters.
Parameters: s - the string to encode Parameters: breakLines - Break lines at 80 characters or less. | public static void | main(String[] args) Testing. |
DECODE | final public static boolean DECODE(Code) | | Specify decoding (value is false).
|
ENCODE | final public static boolean ENCODE(Code) | | Specify encoding (value is true).
|
decode | public static byte[] decode(String s)(Code) | | Decodes data from Base64 notation.
Parameters: s - the string to decode the decoded data since: 1.4 |
decode | public static byte[] decode(byte[] source, int off, int len)(Code) | | Decodes Base64 content in byte array format and returns
the decoded byte array.
Parameters: source - The Base64 encoded data Parameters: off - The offset of where to begin decoding Parameters: len - The length of characters to decode decoded data since: 1.3 |
decodeToObject | public static Object decodeToObject(String encodedObject)(Code) | | Attempts to decode Base64 data and deserialize a Java
Object within. Returns null if there was an error.
Parameters: encodedObject - The Base64 data to decode The decoded and deserialized object since: 1.4 |
decodeToString | public static String decodeToString(String s)(Code) | | Decodes data from Base64 notation and
returns it as a string.
Equivlaent to calling
new String( decode( s ) )
Parameters: s - the strind to decode The data as a string since: 1.4 |
encodeBytes | public static String encodeBytes(byte[] source)(Code) | | Encodes a byte array into Base64 notation.
Equivalen to calling
encodeBytes( source, 0, source.length )
Parameters: source - The data to convert since: 1.4 |
encodeBytes | public static String encodeBytes(byte[] source, boolean breakLines)(Code) | | Encodes a byte array into Base64 notation.
Equivalen to calling
encodeBytes( source, 0, source.length )
Parameters: source - The data to convert Parameters: breakLines - Break lines at 80 characters or less. since: 1.4 |
encodeBytes | public static String encodeBytes(byte[] source, int off, int len)(Code) | | Encodes a byte array into Base64 notation.
Parameters: source - The data to convert Parameters: off - Offset in array where conversion should begin Parameters: len - Length of data to convert since: 1.4 |
encodeBytes | public static String encodeBytes(byte[] source, int off, int len, boolean breakLines)(Code) | | Encodes a byte array into Base64 notation.
Parameters: source - The data to convert Parameters: off - Offset in array where conversion should begin Parameters: len - Length of data to convert Parameters: breakLines - Break lines at 80 characters or less. since: 1.4 |
encodeObject | public static String encodeObject(java.io.Serializable serializableObject)(Code) | | Serializes an object and returns the Base64-encoded
version of that serialized object. If the object
cannot be serialized or there is another error,
the method will return null.
Parameters: serializableObject - The object to encode The Base64-encoded object since: 1.4 |
encodeObject | public static String encodeObject(java.io.Serializable serializableObject, boolean breakLines)(Code) | | Serializes an object and returns the Base64-encoded
version of that serialized object. If the object
cannot be serialized or there is another error,
the method will return null.
Parameters: serializableObject - The object to encode Parameters: breakLines - Break lines at 80 characters or less. The Base64-encoded object since: 1.4 |
encodeString | public static String encodeString(String s)(Code) | | Encodes a string in Base64 notation with line breaks
after every 75 Base64 characters.
Parameters: s - the string to encode the encoded string since: 1.3 |
encodeString | public static String encodeString(String s, boolean breakLines)(Code) | | Encodes a string in Base64 notation with line breaks
after every 75 Base64 characters.
Parameters: s - the string to encode Parameters: breakLines - Break lines at 80 characters or less. the encoded string since: 1.3 |
main | public static void main(String[] args)(Code) | | Testing. Feel free--in fact I encourage you--to throw out
this entire "main" method when you actually deploy this code.
|
|
|