thinkAlike
Class Base64

java.lang.Object
  extended by thinkAlike.Base64

public class Base64
extends java.lang.Object

Provides methods for base64 encoding/decoding.


Constructor Summary
Base64()
           
 
Method Summary
static byte[] decode(java.lang.String b64Str)
          Decodes a base64 string into a byte array (not tested).
static java.lang.String encode(byte[] buff)
          Encodes a byte array into base64.
static java.lang.String encode(java.lang.String str)
          Encodes the string in base64.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Base64

public Base64()
Method Detail

encode

public static java.lang.String encode(java.lang.String str)
Encodes the string in base64.

Parameters:
str - A string to be encoded.
Returns:
The base64 encoded string.

encode

public static java.lang.String encode(byte[] buff)
Encodes a byte array into base64.

Parameters:
buff - A byte array.
Returns:
A string representing the base64 encoding of the byte array buff.

decode

public static byte[] decode(java.lang.String b64Str)
Decodes a base64 string into a byte array (not tested).

Parameters:
b64Str - A base64 string.
Returns:
The byte array corresponding to the base64 string.