g-Eclipse
Release 1.0.0

eu.geclipse.core.security
Class Base64

java.lang.Object
  extended by eu.geclipse.core.security.Base64

public class Base64
extends java.lang.Object

A configurable Base64 codec.


Constructor Summary
Base64()
          Create a defaut Base64 codec.
 
Method Summary
 byte[] decode(byte[] encoded)
          Decode the specified byte array using the current decoding table and the current fill byte.
 java.lang.String decode(java.lang.String encoded)
          Decode the specified string using the current decoding table and the current fill byte.
 byte[] encode(byte[] decoded)
          Encode the specified byte array using the current encoding table and the current fill byte.
 java.lang.String encode(java.lang.String decoded)
          Encode the specified string using the current encoding table and the current fill byte.
 void setDecodingTable(byte[] table)
          Set the current decoding table to the specified one.
 void setEncodingTable(byte[] table, boolean changeDecoding)
          Set the current encoding table to the specified one.
 void setFillByte(byte b)
          Set the current fill byte to the specified one.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Base64

public Base64()
Create a defaut Base64 codec. The codec is initialized with the default en-/decoding tables and the default fill byte.

Method Detail

decode

public java.lang.String decode(java.lang.String encoded)
Decode the specified string using the current decoding table and the current fill byte.

Parameters:
encoded - The encoded string.
Returns:
The decoded string.

decode

public byte[] decode(byte[] encoded)
Decode the specified byte array using the current decoding table and the current fill byte.

Parameters:
encoded - The encoded byte array.
Returns:
The decoded byte array.

encode

public java.lang.String encode(java.lang.String decoded)
Encode the specified string using the current encoding table and the current fill byte.

Parameters:
decoded - The decoded string.
Returns:
The encoded string.

encode

public byte[] encode(byte[] decoded)
Encode the specified byte array using the current encoding table and the current fill byte.

Parameters:
decoded - The decoded byte array.
Returns:
The encoded byte array.

setDecodingTable

public void setDecodingTable(byte[] table)
Set the current decoding table to the specified one.

Parameters:
table - The new decoding table.

setEncodingTable

public void setEncodingTable(byte[] table,
                             boolean changeDecoding)
Set the current encoding table to the specified one. This method changes the current decoding table accordingly if changeDecoding is set to true.

Parameters:
table - The new encoding table.
changeDecoding - If true the decoding table is changed as well.

setFillByte

public void setFillByte(byte b)
Set the current fill byte to the specified one.

Parameters:
b - The new fill byte.

g-Eclipse
Release 1.0.0