public final class UTF8Reader
extends java.io.Reader
Modifier and Type | Field and Description |
---|---|
protected byte[][] |
_bufferHolder |
protected static java.lang.ThreadLocal<java.lang.ref.SoftReference<byte[][]>> |
_bufferRecycler
This
ThreadLocal contains a java.lang.ref.SoftRerefence
to a byte array used for holding content to decode |
protected byte[] |
_inputBuffer |
protected int |
_inputEnd
Pointed to the end marker, that is, position one after the last
valid available byte.
|
protected int |
_inputPtr
Pointer to the next available byte (if any), iff less than
mByteBufferEnd |
protected int |
_surrogate
Decoded first character of a surrogate pair, if one needs to be buffered
|
Constructor and Description |
---|
UTF8Reader(byte[] buf,
int ptr,
int len,
boolean autoClose) |
UTF8Reader(java.io.InputStream in,
boolean autoClose) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
freeBuffers()
This method should be called along with (or instead of) normal
close.
|
protected java.io.InputStream |
getStream() |
int |
read()
Although this method is implemented by the base class, AND it should
never be called by Woodstox code, let's still implement it bit more
efficiently just in case
|
int |
read(char[] cbuf) |
int |
read(char[] cbuf,
int start,
int len) |
protected 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 int |
readBytesAt(int offset)
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 |
reportBounds(char[] cbuf,
int start,
int len) |
protected void |
reportStrangeStream() |
protected static final java.lang.ThreadLocal<java.lang.ref.SoftReference<byte[][]>> _bufferRecycler
ThreadLocal
contains a java.lang.ref.SoftRerefence
to a byte array used for holding content to decodeprotected final byte[][] _bufferHolder
protected byte[] _inputBuffer
protected int _inputPtr
mByteBufferEnd
protected int _inputEnd
protected int _surrogate
public UTF8Reader(java.io.InputStream in, boolean autoClose)
public UTF8Reader(byte[] buf, int ptr, int len, boolean autoClose)
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Reader
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public int read(char[] cbuf) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public int read(char[] cbuf, int start, int len) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
protected final java.io.InputStream getStream()
protected final int readBytes() throws java.io.IOException
java.io.IOException
protected final int readBytesAt(int offset) throws java.io.IOException
java.io.IOException
public final void freeBuffers()
protected void reportBounds(char[] cbuf, int start, int len) throws java.io.IOException
java.io.IOException
protected void reportStrangeStream() throws java.io.IOException
java.io.IOException
Copyright © 2013. All Rights Reserved.