|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Reader
com.ctc.wstx.io.ISOLatinReader
public final class ISOLatinReader
Optimized Reader that reads ISO-Latin (aka ISO-8859-1) content from an input stream. In addition to doing (hopefully) optimal conversion, it can also take array of "pre-read" (leftover) bytes; this is necessary when preliminary stream/reader is trying to figure out XML encoding.
Field Summary | |
---|---|
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
|
protected static char |
NULL_BYTE
|
protected static char |
NULL_CHAR
|
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
ISOLatinReader(ReaderConfig cfg,
InputStream in,
byte[] buf,
int ptr,
int len,
boolean recycleBuffer)
|
Method Summary | |
---|---|
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 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 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 |
reportInvalidXml11(int value,
int bytePos,
int charPos)
|
protected void |
reportStrangeStream()
|
void |
setXmlCompliancy(int xmlVersion)
Method that can be called to indicate the xml conformance used when reading content using this reader. |
Methods inherited from class java.io.Reader |
---|
mark, markSupported, read, read, ready, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
protected final ReaderConfig mConfig
protected byte[] mByteBuffer
protected int mBytePtr
mByteBufferEnd
protected int mByteBufferEnd
Constructor Detail |
---|
public ISOLatinReader(ReaderConfig cfg, InputStream in, byte[] buf, int ptr, int len, boolean recycleBuffer)
Method Detail |
---|
public void setXmlCompliancy(int xmlVersion)
public int read(char[] cbuf, int start, int len) throws IOException
read
in class Reader
IOException
protected final boolean canModifyBuffer()
public void close() throws IOException
close
in interface Closeable
close
in class Reader
IOException
public int read() throws IOException
read
in class Reader
IOException
protected final InputStream getStream()
protected final int readBytes() throws IOException
IOException
protected final int readBytesAt(int offset) throws IOException
IOException
public final void freeBuffers()
protected void reportBounds(char[] cbuf, int start, int len) throws IOException
IOException
protected void reportStrangeStream() throws IOException
IOException
protected void reportInvalidXml11(int value, int bytePos, int charPos) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |