1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Sat Jan 02 02:58:02 GMT 1999 -->
<title>
Interface com.jclark.xml.tok.ByteToCharConverter
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-com.jclark.xml.tok.html">This Package</a> <a href="Package-com.jclark.xml.tok.html">Previous</a> <a href="Package-com.jclark.xml.tok.html">Next</a> <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
Interface com.jclark.xml.tok.ByteToCharConverter
</h1>
<dl>
<dt> public interface <b>ByteToCharConverter</b>
</dl>
Converts bytes to characters.
An encoding that maps sequences of characters to sequences of bytes
can be supported by this interface if:
<ul>
<li>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
<li>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.
</ul>
<p>
<hr>
<a name="index"></a>
<h2>
<img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#convertBytes(byte[], int)"><b>convertBytes</b></a>(byte[], int)
<dd> Returns the Unicode scalar value of the character encoded
by the <code>n</code> bytes in
<code>buf</code> starting at offset <code>off</code>,
where <code>n >= 2</code> and
<code>n = -getLeadByteType(buf[off])</code>.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#getLeadByteType(byte)"><b>getLeadByteType</b></a>(byte)
<dd> If the byte <code>b</code> by itself
encodes a character whose Unicode scalar value is <code>c</code>,
returns <code>c</code>.
</dl>
<a name="methods"></a>
<h2>
<img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getLeadByteType(byte)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getLeadByteType"><b>getLeadByteType</b></a>
<pre>
public abstract int getLeadByteType(byte b)
</pre>
<dl>
<dd> If the byte <code>b</code> by itself
encodes a character whose Unicode scalar value is <code>c</code>,
returns <code>c</code>.
If the byte <code>b</code> is the first byte
of a <code>n</code>-byte sequence that encodes a character
where <code>n >= 2</code>, returns <code>-n</code>.
Otherwise return -1.
<p>
</dl>
<a name="convertBytes(byte[], int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="convertBytes"><b>convertBytes</b></a>
<pre>
public abstract int convertBytes(byte buf[],
int off)
</pre>
<dl>
<dd> Returns the Unicode scalar value of the character encoded
by the <code>n</code> bytes in
<code>buf</code> starting at offset <code>off</code>,
where <code>n >= 2</code> and
<code>n = -getLeadByteType(buf[off])</code>.
Returns -1 if the bytes do not encode any character.
<p>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-com.jclark.xml.tok.html">This Package</a> <a href="Package-com.jclark.xml.tok.html">Previous</a> <a href="Package-com.jclark.xml.tok.html">Next</a> <a href="AllNames.html">Index</a></pre>
</body>
</html>
|