abstract class BaseReader
extends java.io.Reader
Modifier and Type | Field and Description |
---|---|
(package private) static char |
CHAR_DEL
DEL character is both the last ascii char, and illegal in xml 1.1.
|
protected static char |
CONVERT_LSEP_TO
In xml 1.1, LSEP bit like \n, or \r.
|
protected static char |
CONVERT_NEL_TO
In xml 1.1, NEL (0x85) behaves much the way \n does (can
be follow \r as part of the linefeed
|
protected byte[] |
mByteBuffer |
protected int |
mByteBufferEnd
Pointed to the end marker, that is, position one after the last
valid available byte.
|
protected int |
mBytePtr
Pointer to the next available byte (if any), iff less than
mByteBufferEnd |
protected ReaderConfig |
mConfig |
private java.io.InputStream |
mIn |
private boolean |
mRecycleBuffer
Flag that indicates whether the read buffer is to be recycled
when Reader is closed or not.
|
protected char[] |
mTmpBuf |
protected static char |
NULL_BYTE |
protected static char |
NULL_CHAR |
Modifier | Constructor and Description |
---|---|
protected |
BaseReader(ReaderConfig cfg,
java.io.InputStream in,
byte[] buf,
int ptr,
int len,
boolean recycleBuffer) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canModifyBuffer()
Method that can be used to see if we can actually modify the
underlying buffer.
|
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
|
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 |
reportInvalidXml11(int value,
int bytePos,
int charPos) |
protected void |
reportStrangeStream() |
abstract void |
setXmlCompliancy(int xmlVersion)
Method that can be called to indicate the xml conformance used
when reading content using this reader.
|
protected static final char NULL_CHAR
protected static final char NULL_BYTE
protected static final char CONVERT_NEL_TO
protected static final char CONVERT_LSEP_TO
static final char CHAR_DEL
protected final ReaderConfig mConfig
private java.io.InputStream mIn
protected byte[] mByteBuffer
protected int mBytePtr
mByteBufferEnd
protected int mByteBufferEnd
private final boolean mRecycleBuffer
protected char[] mTmpBuf
protected BaseReader(ReaderConfig cfg, java.io.InputStream in, byte[] buf, int ptr, int len, boolean recycleBuffer)
public abstract void setXmlCompliancy(int xmlVersion)
protected final boolean canModifyBuffer()
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
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
protected void reportInvalidXml11(int value, int bytePos, int charPos) throws java.io.IOException
java.io.IOException