com.webmethods.rtl.encode
Class CharRefEncoder

java.lang.Object
  extended by com.webmethods.rtl.encode.Encoder
      extended by com.webmethods.rtl.encode.CharRefEncoder

public class CharRefEncoder
extends Encoder

Encodes to and from XML char refs. Escapes chars less than 32 and greater than 126.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.webmethods.rtl.encode.Encoder
Encoder.FixedCharArrayWriter
 
Field Summary
protected static char[] CHAR_REF_START
           
protected static Encoder encoder
           
 
Constructor Summary
CharRefEncoder()
           
 
Method Summary
 int decode(char[] src, int soff, int len, Writer dst)
          Decodes from XML char refs.
 int encode(char[] src, int soff, int len, Writer dst)
          Encodes to XML (decimal) char refs.
static Encoder encoder()
          Returns the encoder instance.
 
Methods inherited from class com.webmethods.rtl.encode.Encoder
decode, decode, decode, decode, decode, decode, encode, encode, encode, encode, encode, encode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHAR_REF_START

protected static final char[] CHAR_REF_START

encoder

protected static Encoder encoder
Constructor Detail

CharRefEncoder

public CharRefEncoder()
Method Detail

encoder

public static Encoder encoder()
Returns the encoder instance.


encode

public int encode(char[] src,
                  int soff,
                  int len,
                  Writer dst)
           throws IOException
Encodes to XML (decimal) char refs.

Specified by:
encode in class Encoder
Parameters:
src - Char array to encode.
soff - Offset in the src array at which to begin reading.
len - 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 int decode(char[] src,
                  int soff,
                  int len,
                  Writer dst)
           throws IOException
Decodes from XML char refs.

Specified by:
decode in class Encoder
Parameters:
src - Char array to decode.
soff - Offset in the src array at which to begin reading.
len - Length of src array to decode.
dst - Writer in which to write the decoded chars.
Returns:
Length of chars written to dst.
Throws:
IOException