com.imaginary.util
Class Encoder

java.lang.Object
  |
  +--com.imaginary.util.Encoder
Direct Known Subclasses:
Base64Encoder

public abstract class Encoder
extends java.lang.Object

Provides a generic interface for data encoding operations. This class is agnostic about the type of encoding going on. It simply prescribes two methods for taking a string or an array of bytes and translating that data into some other form.

Accessing encoders should be done through this class in the following manner:

 Encoder encoder = Encoder.getInstance(Encoder.BASE64);
 

Last modified $Date: 1999/11/06 19:50:51 $


Field Summary
static int BASE64
          The encoder for BASE64 encoding.
 
Constructor Summary
Encoder()
           
 
Method Summary
abstract  byte[] decode(byte[] encoded)
           
abstract  byte[] decode(java.lang.String encoded)
           
abstract  byte[] encode(byte[] decoded)
           
abstract  byte[] encode(java.lang.String decoded)
           
static Encoder getInstance(int type)
          Provides an instance of the specified encoder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASE64

public static final int BASE64
The encoder for BASE64 encoding.
Constructor Detail

Encoder

public Encoder()
Method Detail

getInstance

public static Encoder getInstance(int type)
                           throws NoSuchEncoderException
Provides an instance of the specified encoder.

decode

public abstract byte[] decode(byte[] encoded)

decode

public abstract byte[] decode(java.lang.String encoded)

encode

public abstract byte[] encode(byte[] decoded)

encode

public abstract byte[] encode(java.lang.String decoded)