Class AbstractCharDecoder
java.lang.Object
org.apache.batik.util.io.AbstractCharDecoder
- All Implemented Interfaces:
CharDecoder
- Direct Known Subclasses:
ASCIIDecoder, ISO_8859_1Decoder, UTF16Decoder, UTF8Decoder
This class is the superclass of all the char decoders.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]The input buffer.protected static final intThe buffer size.protected intThe byte count in the buffer.protected InputStreamThe input stream to read.protected intThe current position in the buffer.Fields inherited from interface CharDecoder
END_OF_STREAM -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new CharDecoder object. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidTo throws an exception when the input stream contains an invalid character.voiddispose()Disposes the associated resources.protected voidendOfStreamError(String encoding) To throws an exception when the end of stream was unexpected.protected voidFills the input buffer.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CharDecoder
readChar
-
Field Details
-
BUFFER_SIZE
protected static final int BUFFER_SIZEThe buffer size.- See Also:
-
inputStream
The input stream to read. -
buffer
protected byte[] bufferThe input buffer. -
position
protected int positionThe current position in the buffer. -
count
protected int countThe byte count in the buffer.
-
-
Constructor Details
-
AbstractCharDecoder
Creates a new CharDecoder object.- Parameters:
is- The stream to read.
-
-
Method Details
-
dispose
Disposes the associated resources.- Specified by:
disposein interfaceCharDecoder- Throws:
IOException
-
fillBuffer
-
charError
To throws an exception when the input stream contains an invalid character.- Parameters:
encoding- The encoding name.- Throws:
IOException
-
endOfStreamError
To throws an exception when the end of stream was unexpected.- Parameters:
encoding- The encoding name.- Throws:
IOException
-