| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private int | _byteCount
Total read byte count; used for error reporting purposes |
| private int | _charCount
Total read character count; used for error reporting purposes |
| private int | _decodeErrorOffset
Flag that is set when a pending decode error has been detected; needed to properly handle deferred reporting. |
| private byte[] | |
| private int | _inputEnd
Pointed to the end marker, that is, position one after the last valid available byte. |
| private int | _inputPtr
Pointer to the next available byte (if any), iff less than
|
| private InputStream | |
| private final IOContext | _ioContext
IO context to use for returning input buffer, iff buffer is to be recycled when input ends. |
| private int | _surrogate
Decoded first character of a surrogate pair, if one needs to be buffered |
| private char[] |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected final boolean | |
| public void | close()
Implements abstract java. Implements java. Closes the stream and releases any system resources associated with it. |
| public final void | |
| protected final InputStream | |
| private boolean | Returns: True, if enough bytes were read to allow decoding of at least one full character; false if EOF was encountered instead.Number of "unused" bytes in the input buffer available)
|
| public int | read()
Overrides java. Although this method is implemented by the base class, AND it should never be called by parser code, let's still implement it bit more efficiently just in case |
| public int | |
| public int | read(final char[]
Destination buffer cbuf, final int Offset at which to start storing characters start, int Maximum number of characters to read len)Implements abstract java. Reads characters into a portion of an array. |
| protected final int | readBytes()
Method for reading as many bytes from the underlying stream as possible (that fit in the buffer), to the beginning of the buffer. |
| protected final int | Returns: Number of bytes read, if any; -1 to indicate none available (that is, end of input)Method for reading as many bytes from the underlying stream as possible (that fit in the buffer considering offset), to the specified offset. |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void |
| _autoClose | back to summary |
|---|---|
| private final boolean _autoClose | |
| _byteCount | back to summary |
|---|---|
| private int _byteCount Total read byte count; used for error reporting purposes | |
| _charCount | back to summary |
|---|---|
| private int _charCount Total read character count; used for error reporting purposes | |
| _decodeErrorOffset | back to summary |
|---|---|
| private int _decodeErrorOffset Flag that is set when a pending decode error has been detected; needed to properly handle deferred reporting. | |
| _inputBuffer | back to summary |
|---|---|
| private byte[] _inputBuffer | |
| _inputEnd | back to summary |
|---|---|
| private int _inputEnd Pointed to the end marker, that is, position one after the last valid available byte. | |
| _inputPtr | back to summary |
|---|---|
| private int _inputPtr Pointer to the next available byte (if any), iff less than
| |
| _inputSource | back to summary |
|---|---|
| private InputStream _inputSource | |
| _ioContext | back to summary |
|---|---|
| private final IOContext _ioContext IO context to use for returning input buffer, iff buffer is to be recycled when input ends. | |
| _surrogate | back to summary |
|---|---|
| private int _surrogate Decoded first character of a surrogate pair, if one needs to be buffered | |
| _tmpBuffer | back to summary |
|---|---|
| private char[] _tmpBuffer | |
| UTF8Reader | back to summary |
|---|---|
| public UTF8Reader(IOContext ctxt, InputStream in, boolean autoClose, byte[] buf, int ptr, int len) | |
| UTF8Reader | back to summary |
|---|---|
| public UTF8Reader(IOContext ctxt, byte[] buf, int ptr, int len) | |
| UTF8Reader | back to summary |
|---|---|
| public UTF8Reader(IOContext ctxt, InputStream in, boolean autoClose) | |
| canModifyBuffer | back to summary |
|---|---|
| protected final boolean canModifyBuffer() Method that can be used to see if we can actually modify the underlying buffer. This is the case if we are managing the buffer, but not if it was just given to us. | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements abstract java. Implements java. Doc from java. Closes the stream and releases any system resources associated with it. Once the stream has been closed, further read(), ready(), mark(), reset(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect.
| |
| freeBuffers | back to summary |
|---|---|
| public final void freeBuffers() This method should be called along with (or instead of) normal close. After calling this method, no further reads should be tried. Method will try to recycle read buffers (if any). | |
| getStream | back to summary |
|---|---|
| protected final InputStream getStream() | |
| loadMore | back to summary |
|---|---|
private boolean loadMore(int available) throws IOException
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Overrides java. Although this method is implemented by the base class, AND it should never be called by parser code, let's still implement it bit more efficiently just in case
| |
| read | back to summary |
|---|---|
| public int read(char[] cbuf) throws IOException Overrides java. Doc from java. Reads characters into an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached. If the length of
| |
| read | back to summary |
|---|---|
| public int read(final char[] cbuf, final int start, int len) throws IOException Implements abstract java. Doc from java. Reads characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached. If
| |
| readBytes | back to summary |
|---|---|
| protected final int readBytes() throws IOException Method for reading as many bytes from the underlying stream as possible (that fit in the buffer), to the beginning of the buffer. | |
| readBytesAt | back to summary |
|---|---|
| protected final int readBytesAt(int offset) throws IOException Method for reading as many bytes from the underlying stream as possible (that fit in the buffer considering offset), to the specified offset.
| |
| reportBounds | back to summary |
|---|---|
| protected void reportBounds(char[] cbuf, int start, int len) throws IOException | |
| reportDeferredInvalid | back to summary |
|---|---|
| protected void reportDeferredInvalid() throws IOException | |
| reportInvalidInitial | back to summary |
|---|---|
| protected void reportInvalidInitial(int mask, int outputDecoded) throws IOException | |
| reportInvalidOther | back to summary |
|---|---|
| protected void reportInvalidOther(int mask, int outputDecoded, int errorPosition) throws IOException | |
| reportStrangeStream | back to summary |
|---|---|
| protected void reportStrangeStream() throws IOException | |
| reportUnexpectedEOF | back to summary |
|---|---|
| protected void reportUnexpectedEOF(int gotBytes, int needed) throws IOException | |