All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.jclark.xml.tok.ByteToCharConverter

public interface ByteToCharConverter
Converts bytes to characters. An encoding that maps sequences of characters to sequences of bytes can be supported by this interface if:


Method Index

 o convertBytes(byte[], int)
Returns the Unicode scalar value of the character encoded by the n bytes in buf starting at offset off, where n >= 2 and n = -getLeadByteType(buf[off]).
 o getLeadByteType(byte)
If the byte b by itself encodes a character whose Unicode scalar value is c, returns c.

Methods

 o getLeadByteType
 public abstract int getLeadByteType(byte b)
If the byte b by itself encodes a character whose Unicode scalar value is c, returns c. If the byte b is the first byte of a n-byte sequence that encodes a character where n >= 2, returns -n. Otherwise return -1.

 o convertBytes
 public abstract int convertBytes(byte buf[],
                                  int off)
Returns the Unicode scalar value of the character encoded by the n bytes in buf starting at offset off, where n >= 2 and n = -getLeadByteType(buf[off]). Returns -1 if the bytes do not encode any character.


All Packages  Class Hierarchy  This Package  Previous  Next  Index