com.webmethods.rtl.encode
Class Encoder

java.lang.Object
  extended by com.webmethods.rtl.encode.Encoder
Direct Known Subclasses:
AsciiEncoder, BASE64Encoder, CharRefEncoder, HexEncoder, HTMLEncoder, JavaEncoder, JSEncoder, RegexpEncoder, ToolTipEncoder, URLEncoder, XMLEncoder

public abstract class Encoder
extends Object

Encoder base class.


Nested Class Summary
protected  class Encoder.FixedCharArrayWriter
          CharArrayWriter that allows one to specify the char array buffer in which to write.
 
Constructor Summary
Encoder()
           
 
Method Summary
 char[] decode(char[] src)
          Decodes from the format.
 int decode(char[] src, char[] dst, int doffset)
          Decodes from the format to the specified char array.
 char[] decode(char[] src, int soffset, int length)
          Decodes from the format.
abstract  int decode(char[] src, int soffset, int length, Writer dst)
          Decodes from the format.
 int decode(char[] src, Writer dst)
          Decodes from the format to the specified char array.
 String decode(String src)
          Decodes from the format.
 int decode(String src, Writer dst)
          Decodes from the format to the specified string.
 char[] encode(char[] src)
          Encodes to the format.
 int encode(char[] src, char[] dst, int doffset)
          Encodes to the format to the specified char array.
 char[] encode(char[] src, int soffset, int length)
          Encodes to the format.
abstract  int encode(char[] src, int soffset, int length, Writer dst)
          Encodes to the format.
 int encode(char[] src, Writer dst)
          Encodes to the format to the specified char array.
 String encode(String src)
          Encodes to the format.
 int encode(String src, Writer dst)
          Encodes to the format to the specified string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Encoder

public Encoder()
Method Detail

encode

public String encode(String src)
Encodes to the format.

Parameters:
src - String to encode.
Returns:
Encoded String.

decode

public String decode(String src)
Decodes from the format.

Parameters:
src - String to decode.
Returns:
Decoded String.

encode

public char[] encode(char[] src)
Encodes to the format.

Parameters:
src - Char array to encode.
Returns:
Encoded char array.

decode

public char[] decode(char[] src)
Decodes from the format.

Parameters:
src - Char array to decode.
Returns:
Decoded char array.

encode

public int encode(char[] src,
                  char[] dst,
                  int doffset)
Encodes to the format to the specified char array.

Parameters:
src - Char array to encode.
dst - Char array in which write the encoded chars.
doffset - Offset in the dst char array at which to begin writing.
Returns:
Length of chars added to dst array.

decode

public int decode(char[] src,
                  char[] dst,
                  int doffset)
Decodes from the format to the specified char array.

Parameters:
src - Char array to decode.
dst - Char array in which to write the decoded chars.
doffset - Offset in the dst char array at which to begin writing.
Returns:
Length of chars added to dst array.

encode

public int encode(String src,
                  Writer dst)
           throws IOException
Encodes to the format to the specified string.

Parameters:
src - String to encode.
dst - Writer in which to write the encoded chars.
Returns:
Length of chars added to dst array.
Throws:
IOException

decode

public int decode(String src,
                  Writer dst)
           throws IOException
Decodes from the format to the specified string.

Parameters:
src - String to decode.
dst - Writer in which write the encoded chars.
Returns:
Length of chars added to dst array.
Throws:
IOException

encode

public int encode(char[] src,
                  Writer dst)
           throws IOException
Encodes to the format to the specified char array.

Parameters:
src - Char array to encode.
dst - Writer in which to write the encoded chars.
Returns:
Length of chars added to dst array.
Throws:
IOException

decode

public int decode(char[] src,
                  Writer dst)
           throws IOException
Decodes from the format to the specified char array.

Parameters:
src - Char array to decode.
dst - Writer in which write the encoded chars.
Returns:
Length of chars added to dst array.
Throws:
IOException

encode

public char[] encode(char[] src,
                     int soffset,
                     int length)
Encodes to the format.

Parameters:
src - Char array to encode.
soffset - Offset in the src array at which to begin reading.
length - Length of src array to encode.
Returns:
Encoded char array.

decode

public char[] decode(char[] src,
                     int soffset,
                     int length)
Decodes from the format.

Parameters:
src - Char array to decode.
soffset - Offset in the src array at which to begin reading.
length - Length of src array to decode.
Returns:
Decoded char array.

encode

public abstract int encode(char[] src,
                           int soffset,
                           int length,
                           Writer dst)
                    throws IOException
Encodes to the format.

Parameters:
src - Char array to encode.
soffset - Offset in the src array at which to begin reading.
length - Length of src array to encode.
dst - Writer in which to write the encoded chars.
Returns:
Length of chars written to dst.
Throws:
IOException

decode

public abstract int decode(char[] src,
                           int soffset,
                           int length,
                           Writer dst)
                    throws IOException
Decodes from the format.

Parameters:
src - Char array to decode.
soffset - Offset in the src array at which to begin reading.
length - Length of src array to decode.
dst - Writer in which to write the decoded chars.
Returns:
Length of chars written to dst.
Throws:
IOException