Class UTF8InputStream
java.lang.Object
|
+----java.io.InputStream
|
+----java.io.FilterInputStream
|
+----UTF8InputStream
- public class UTF8InputStream
- extends FilterInputStream
- implements CharInputStream
A "FilterInputStream" for decoding UTF8 streams.
Adds a method "readChar" that returns the next character from
a UTF8 encoded input stream.
-
UTF8InputStream(InputStream)
- Initializer: creates a new UTF8 stream.
-
readChar()
- Return next character.
UTF8InputStream
public UTF8InputStream(InputStream in)
- Initializer: creates a new UTF8 stream.
- Parameters:
- in - the input stream
readChar
public int readChar() throws UTFDataFormatException, IOException
- Return next character. Will block until enough bytes
are available. Reads the required number of bytes (a
variable number) and computes the corresponding
(Unicode) character, which is returned.
- Returns:
- the Unicode number of the character read,
or -1 if the end of the input is reached.
- See Also:
- CharInputStream