public final class Utf32Reader
extends java.io.Reader
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
mBigEndian |
protected byte[] |
mBuffer |
(package private) int |
mByteCount
Total read byte count; used for error reporting purposes
|
(package private) int |
mCharCount
Total read character count; used for error reporting purposes
|
(package private) ReaderConfig |
mConfig |
protected java.io.InputStream |
mIn |
protected int |
mLength |
protected int |
mPtr |
(package private) char |
mSurrogate
Although input is fine with full Unicode set, Java still uses
16-bit chars, so we may have to split high-order chars into
surrogate pairs.
|
(package private) char[] |
mTmpBuf |
(package private) static char |
NULL_CHAR |
Constructor and Description |
---|
Utf32Reader(ReaderConfig cfg,
java.io.InputStream in,
byte[] buf,
int ptr,
int len,
boolean isBigEndian) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
freeBuffers() |
private boolean |
loadMore(int available) |
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 start,
int len) |
protected void |
reportBounds(char[] cbuf,
int start,
int len) |
private void |
reportInvalid(int value,
int offset,
java.lang.String msg) |
protected void |
reportStrangeStream() |
private void |
reportUnexpectedEOF(int gotBytes,
int needed) |
static final char NULL_CHAR
final ReaderConfig mConfig
protected java.io.InputStream mIn
protected byte[] mBuffer
protected int mPtr
protected int mLength
final boolean mBigEndian
char mSurrogate
int mCharCount
int mByteCount
char[] mTmpBuf
public Utf32Reader(ReaderConfig cfg, java.io.InputStream in, byte[] buf, int ptr, int len, boolean isBigEndian)
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, int start, int len) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
private boolean loadMore(int available) throws java.io.IOException
available
- Number of "unused" bytes in the input bufferjava.io.IOException
public final void freeBuffers()
private void reportUnexpectedEOF(int gotBytes, int needed) throws java.io.IOException
java.io.IOException
private void reportInvalid(int value, int offset, java.lang.String msg) throws java.io.IOException
java.io.IOException
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