org.castor.util
Class Base64Encoder
public final
class
Base64Encoder
extends Object
Class encodes the bytes written to the OutPutStream to a Base64 encoded string.
The encoded string can be retrieved by as a whole by the toString() method or
splited into lines of 72 characters by the toStringArray() method.
Since: 0.9.9
Version: $Revision: 5951 $ $Date: 2005-08-05 13:58:36 -0600 (Fri, 05 Aug 2005) $
Author: Ralf Joachim
Method Summary |
static char[] | encode(byte[] bytes)
Encode given byte array into a encoded character array.
|
char[] | getCharArray()
Get Base64 encoded characters as an array.
|
void | reset()
Reset Base64Encoder to its initial state. |
void | translate(byte[] bytes)
Translate all bytes of given array by appending each to octet buffer. |
public Base64Encoder()
Construct a Base64Encoder.
public static char[] encode(byte[] bytes)
Encode given byte array into a encoded character array.
Parameters: bytes The byte array to be encoded.
Returns: Base64 encoded characters as an array.
public char[] getCharArray()
Get Base64 encoded characters as an array.
Returns: Base64 encoded characters as an array.
public void reset()
Reset Base64Encoder to its initial state. Take care using this method as it
throws all previously written bytes away.
public void translate(byte[] bytes)
Translate all bytes of given array by appending each to octet buffer. If
buffer contains 3 octets its content will be encoded to 4 sextet byte values
which are converted to a base64 character each. All characters are appended
to a StringBuffer.
Parameters: bytes The byte array to be encoded.
Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com