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:
 - it is stateless; that is, the sequence of bytes that encodes
 a sequence of characters is the concatenation of the sequences
 of bytes that encodes each character in the sequence; and
 
- the lead byte in the encoding of a character determines the
 number of bytes used to encode a character; that is,
 whenever two sequences of bytes each encode a character, and the
 first byte of each sequence is the same, then the length of the
 sequences is the same.
 
   
  -   convertBytes(byte[], int) convertBytes(byte[], int)
-   Returns the Unicode scalar value of the character encoded
 by the nbytes inbufstarting at offsetoff,
 wheren >= 2andn = -getLeadByteType(buf[off]).
-   getLeadByteType(byte) getLeadByteType(byte)
-   If the byte bby itself
 encodes a character whose Unicode scalar value isc,
 returnsc.
   
 getLeadByteType
getLeadByteType
 public abstract int getLeadByteType(byte b)
  -  If the byte bby itself
 encodes a character whose Unicode scalar value isc,
 returnsc.
 If the bytebis the first byte
 of an-byte sequence that encodes a character
 wheren >= 2, returns-n.
 Otherwise return -1.
 
 convertBytes
convertBytes
 public abstract int convertBytes(byte buf[],
                                  int off)
  -  Returns the Unicode scalar value of the character encoded
 by the nbytes inbufstarting at offsetoff,
 wheren >= 2andn = -getLeadByteType(buf[off]).
 Returns -1 if the bytes do not encode any character.
 
All Packages  Class Hierarchy  This Package  Previous  Next  Index