All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.xmlOnline.parser.UTF8InputStream

java.lang.Object
   |
   +----java.io.InputStream
           |
           +----java.io.FilterInputStream
                   |
                   +----w3c.xmlOnline.parser.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.

This should probably be updated to use the Reader classes from JDK 1.1...

Version:
$Id: w3c.xmlOnline.parser.UTF8InputStream.html,v 1.7 1997/06/09 22:24:58 bbos Exp $
Author:
Bert Bos

Constructor Index

 o UTF8InputStream(InputStream)
Initializer: creates a new UTF8 stream.

Method Index

 o readChar()
Return next character.

Constructors

 o UTF8InputStream
 public UTF8InputStream(InputStream in)
Initializer: creates a new UTF8 stream.

Parameters:
in - the input stream

Methods

 o 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

All Packages  Class Hierarchy  This Package  Previous  Next  Index