Package com.ctc.wstx.io
Class BambooUTF8Reader
- java.lang.Object
-
- java.io.Reader
-
- com.ctc.wstx.io.BambooUTF8Reader
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
public final class BambooUTF8Reader extends Reader
Optimized Reader that reads UTF-8 encoded 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
Fields Modifier and Type Field Description protected static charCONVERT_LSEP_TOprotected static charCONVERT_NEL_TOprotected byte[]mByteBufferprotected intmByteBufferEndprotected intmBytePtrprotected com.ctc.wstx.api.ReaderConfigmConfigprotected static charNULL_BYTEprotected static charNULL_CHAR
-
Constructor Summary
Constructors Constructor Description BambooUTF8Reader(com.ctc.wstx.api.ReaderConfig cfg, InputStream in, byte[] buf, int ptr, int len, boolean recycleBuffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanModifyBuffer()voidclose()voidfreeBuffers()protected InputStreamgetStream()intread()intread(char[] cbuf, int start, int len)protected intreadBytes()protected intreadBytesAt(int arg0)protected voidreportBounds(char[] arg0, int arg1, int arg2)protected voidreportInvalidXml11(int arg0, int arg1, int arg2)protected voidreportStrangeStream()voidsetXmlCompliancy(int xmlVersion)-
Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, ready, reset, skip, transferTo
-
-
-
-
Field Detail
-
NULL_CHAR
protected static final char NULL_CHAR
- See Also:
- Constant Field Values
-
NULL_BYTE
protected static final char NULL_BYTE
- See Also:
- Constant Field Values
-
CONVERT_NEL_TO
protected static final char CONVERT_NEL_TO
- See Also:
- Constant Field Values
-
CONVERT_LSEP_TO
protected static final char CONVERT_LSEP_TO
- See Also:
- Constant Field Values
-
mConfig
protected final com.ctc.wstx.api.ReaderConfig mConfig
-
mByteBuffer
protected byte[] mByteBuffer
-
mBytePtr
protected int mBytePtr
-
mByteBufferEnd
protected int mByteBufferEnd
-
-
Constructor Detail
-
BambooUTF8Reader
public BambooUTF8Reader(com.ctc.wstx.api.ReaderConfig cfg, InputStream in, byte[] buf, int ptr, int len, boolean recycleBuffer)
-
-
Method Detail
-
setXmlCompliancy
public void setXmlCompliancy(int xmlVersion)
-
read
public int read(char[] cbuf, int start, int len) throws IOException- Specified by:
readin classReader- Throws:
IOException
-
canModifyBuffer
protected final boolean canModifyBuffer()
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-
read
public int read() throws IOException- Overrides:
readin classReader- Throws:
IOException
-
getStream
protected final InputStream getStream()
-
readBytes
protected final int readBytes() throws IOException- Throws:
IOException
-
readBytesAt
protected final int readBytesAt(int arg0) throws IOException- Throws:
IOException
-
freeBuffers
public final void freeBuffers()
-
reportBounds
protected void reportBounds(char[] arg0, int arg1, int arg2) throws IOException- Throws:
IOException
-
reportStrangeStream
protected void reportStrangeStream() throws IOException- Throws:
IOException
-
reportInvalidXml11
protected void reportInvalidXml11(int arg0, int arg1, int arg2) throws IOException- Throws:
IOException
-
-