ewe.io
Class Base64Codec

java.lang.Object
  extended byewe.util.Errorable
      extended byewe.io.Base64Codec
Direct Known Subclasses:
Base64Decoder, Base64Encoder

public class Base64Codec
extends Errorable


Field Summary
static String encodingChars
          This returns the six bit value of the character.
 
Fields inherited from class ewe.util.Errorable
error
 
Constructor Summary
Base64Codec()
           
 
Method Summary
 int charToByte(char ch)
           
protected  byte[] closeEncoding()
           
 ByteArray decode(byte[] chars, int offset, int length, ByteArray dest)
           
protected  int decode4(char[] chars, int charOffset, byte[] dest, int destOffset)
          This decodes four characters into between 1 to 3 bytes.
 ByteArray encode(byte[] bytes, int offset, int length, ByteArray dest)
           
protected  int encode3(byte[] bytes, int offset, int length, byte[] dest, int destOffset)
           
 
Methods inherited from class ewe.util.Errorable
returnError, returnError, returnError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Field Detail

encodingChars

public static final String encodingChars
This returns the six bit value of the character. It returns -1 if the character is invalid.

See Also:
Constant Field Values
Constructor Detail

Base64Codec

public Base64Codec()
Method Detail

charToByte

public int charToByte(char ch)

decode4

protected int decode4(char[] chars,
                      int charOffset,
                      byte[] dest,
                      int destOffset)
This decodes four characters into between 1 to 3 bytes. The four characters MUST be valid or '=' signs (for the end of stream padding).


decode

public ByteArray decode(byte[] chars,
                        int offset,
                        int length,
                        ByteArray dest)

encode3

protected int encode3(byte[] bytes,
                      int offset,
                      int length,
                      byte[] dest,
                      int destOffset)

encode

public ByteArray encode(byte[] bytes,
                        int offset,
                        int length,
                        ByteArray dest)

closeEncoding

protected byte[] closeEncoding()