ice.util.encoding
Class Base64

java.lang.Object
  extended byice.util.encoding.Base64

public class Base64
extends Object

This Base64 is a utility class for encoding and decoding using the Base64 encoding. Additionally, it contains other handy methods.

The Base64 encoding is designed to represent arbitrary sequences of octets in a form that need to be humanly readable. The encoding and decoding algorithms are simple, but the encoded data are consitently only about 33% larger than the unencoded data.

For more complete information about the Base64 encoding, please read MIME (Multipurpose Internet Mail Extensions) Part One (Section 5.2).

Version:
1.0
Author:
Jack van Ooststroom

Constructor Summary
Base64()
           
 
Method Summary
static byte[] decode(byte[] bytes)
          Decodes the specified Base64 encoded bytes.
static String decode(String string)
          Decodes the specified Base64 encoded string.
static byte[] encode(byte[] bytes)
          Encodes the specified bytes using the Base64 encoding.
static String encode(String string)
          Encodes the specified string using the Base64 encoding.
static boolean encoded(byte[] bytes)
          Checks to see if the specified bytes is Base64 encoded or not.
static boolean encoded(String string)
          Checks to see if the specified string is Base64 encoded or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Base64

public Base64()
Method Detail

decode

public static byte[] decode(byte[] bytes)

Decodes the specified Base64 encoded bytes.

Parameters:
bytes - the Base64 encoded bytes to be decoded.
Returns:
the decoded bytes.
See Also:
encode(byte[])

decode

public static String decode(String string)

Decodes the specified Base64 encoded string.

Parameters:
string - the Base64 encoded string to be decoded.
Returns:
the decoded string.
See Also:
decode(byte[]), encode(String)

encode

public static byte[] encode(byte[] bytes)

Encodes the specified bytes using the Base64 encoding.

Parameters:
bytes - the bytes to be encoded.
Returns:
the encoded bytes.
See Also:
decode(byte[])

encode

public static String encode(String string)

Encodes the specified string using the Base64 encoding.

Parameters:
string - the string to be encoded.
Returns:
the encoded string.
See Also:
encode(byte[]), decode(String)

encoded

public static boolean encoded(byte[] bytes)

Checks to see if the specified bytes is Base64 encoded or not.

Parameters:
bytes - the bytes to be checked.
Returns:
true if the bytes are Base64 encoded, false if not.

encoded

public static boolean encoded(String string)

Checks to see if the specified string is Base64 encoded or not.

Parameters:
string - the string to be checked.
Returns:
true if the string are Base64 encoded, false if not.
See Also:
encoded(byte[])