org.apache.batik.util.io

Class StreamNormalizingReader

public class StreamNormalizingReader extends NormalizingReader

This class represents a NormalizingReader which handles streams of bytes.
Nested Class Summary
protected static classStreamNormalizingReader.ASCIIDecoderFactory
To create an ASCIIDecoder.
protected interfaceStreamNormalizingReader.CharDecoderFactory
Represents a CharDecoder factory.
protected static classStreamNormalizingReader.ISO_8859_1DecoderFactory
To create an ISO_8859_1Decoder.
protected static classStreamNormalizingReader.UTF16DecoderFactory
To create a UTF16Decoder.
protected static classStreamNormalizingReader.UTF8DecoderFactory
To create a UTF8Decoder.
Field Summary
protected CharDecodercharDecoder
The char decoder.
protected static MapcharDecoderFactories
The CharDecoder factories map.
protected intcolumn
The current column in the stream.
protected intline
The current line in the stream.
protected intnextChar
The next char.
Constructor Summary
StreamNormalizingReader(InputStream is)
Creates a new NormalizingReader.
StreamNormalizingReader(InputStream is, String enc)
Creates a new NormalizingReader.
StreamNormalizingReader(Reader r)
Creates a new NormalizingReader.
protected StreamNormalizingReader()
This constructor is intended for use by subclasses.
Method Summary
voidclose()
Close the stream.
protected CharDecodercreateCharDecoder(InputStream is, String enc)
Creates the CharDecoder mapped with the given encoding name.
intgetColumn()
Returns the current column in the stream.
intgetLine()
Returns the current line in the stream.
intread()
Read a single character.

Field Detail

charDecoder

protected CharDecoder charDecoder
The char decoder.

charDecoderFactories

protected static final Map charDecoderFactories
The CharDecoder factories map.

column

protected int column
The current column in the stream.

line

protected int line
The current line in the stream.

nextChar

protected int nextChar
The next char.

Constructor Detail

StreamNormalizingReader

public StreamNormalizingReader(InputStream is)
Creates a new NormalizingReader. The encoding is assumed to be ISO-8859-1.

Parameters: is The input stream to decode.

StreamNormalizingReader

public StreamNormalizingReader(InputStream is, String enc)
Creates a new NormalizingReader.

Parameters: is The input stream to decode. enc The standard encoding name. A null encoding means ISO-8859-1.

StreamNormalizingReader

public StreamNormalizingReader(Reader r)
Creates a new NormalizingReader.

Parameters: r The reader to wrap.

StreamNormalizingReader

protected StreamNormalizingReader()
This constructor is intended for use by subclasses.

Method Detail

close

public void close()
Close the stream.

createCharDecoder

protected CharDecoder createCharDecoder(InputStream is, String enc)
Creates the CharDecoder mapped with the given encoding name.

getColumn

public int getColumn()
Returns the current column in the stream.

getLine

public int getLine()
Returns the current line in the stream.

read

public int read()
Read a single character. This method will block until a character is available, an I/O error occurs, or the end of the stream is reached.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.