Package org.apache.batik.util.io
Class AbstractCharDecoder
- java.lang.Object
-
- org.apache.batik.util.io.AbstractCharDecoder
-
- All Implemented Interfaces:
CharDecoder
- Direct Known Subclasses:
ASCIIDecoder,ISO_8859_1Decoder,UTF16Decoder,UTF8Decoder
public abstract class AbstractCharDecoder extends java.lang.Object implements CharDecoder
This class is the superclass of all the char decoders.- Version:
- $Id: AbstractCharDecoder.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]bufferThe input buffer.protected static intBUFFER_SIZEThe buffer size.protected intcountThe byte count in the buffer.protected java.io.InputStreaminputStreamThe input stream to read.protected intpositionThe current position in the buffer.-
Fields inherited from interface org.apache.batik.util.io.CharDecoder
END_OF_STREAM
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractCharDecoder(java.io.InputStream is)Creates a new CharDecoder object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcharError(java.lang.String encoding)To throws an exception when the input stream contains an invalid character.voiddispose()Disposes the associated resources.protected voidendOfStreamError(java.lang.String encoding)To throws an exception when the end of stream was unexpected.protected voidfillBuffer()Fills the input buffer.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.batik.util.io.CharDecoder
readChar
-
-
-
-
Field Detail
-
BUFFER_SIZE
protected static final int BUFFER_SIZE
The buffer size.- See Also:
- Constant Field Values
-
inputStream
protected java.io.InputStream inputStream
The input stream to read.
-
buffer
protected byte[] buffer
The input buffer.
-
position
protected int position
The current position in the buffer.
-
count
protected int count
The byte count in the buffer.
-
-
Method Detail
-
dispose
public void dispose() throws java.io.IOExceptionDisposes the associated resources.- Specified by:
disposein interfaceCharDecoder- Throws:
java.io.IOException
-
fillBuffer
protected void fillBuffer() throws java.io.IOExceptionFills the input buffer.- Throws:
java.io.IOException
-
charError
protected void charError(java.lang.String encoding) throws java.io.IOExceptionTo throws an exception when the input stream contains an invalid character.- Parameters:
encoding- The encoding name.- Throws:
java.io.IOException
-
endOfStreamError
protected void endOfStreamError(java.lang.String encoding) throws java.io.IOExceptionTo throws an exception when the end of stream was unexpected.- Parameters:
encoding- The encoding name.- Throws:
java.io.IOException
-
-