Package com.ctc.wstx.io
Class BambooUTF8Reader
java.lang.Object
java.io.Reader
com.ctc.wstx.io.BambooUTF8Reader
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
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
FieldsModifier and TypeFieldDescriptionprotected static final charprotected static final charprotected byte[]protected intprotected intprotected final com.ctc.wstx.api.ReaderConfigprotected char[]protected static final charprotected static final char -
Constructor Summary
ConstructorsConstructorDescriptionBambooUTF8Reader(com.ctc.wstx.api.ReaderConfig cfg, InputStream in, byte[] buf, int ptr, int len, boolean recycleBuffer) -
Method Summary
Modifier and TypeMethodDescriptionprotected final booleanvoidclose()final voidprotected final InputStreamintread()intread(char[] cbuf, int start, int len) protected final intprotected final intreadBytesAt(int arg0) protected voidreportBounds(char[] arg0, int arg1, int arg2) protected voidreportInvalidXml11(int arg0, int arg1, int arg2) protected voidvoidsetXmlCompliancy(int xmlVersion) Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, ready, reset, skip, transferTo
-
Field Details
-
NULL_CHAR
protected static final char NULL_CHAR- See Also:
-
NULL_BYTE
protected static final char NULL_BYTE- See Also:
-
CONVERT_NEL_TO
protected static final char CONVERT_NEL_TO- See Also:
-
CONVERT_LSEP_TO
protected static final char CONVERT_LSEP_TO- See Also:
-
mConfig
protected final com.ctc.wstx.api.ReaderConfig mConfig -
mByteBuffer
protected byte[] mByteBuffer -
mBytePtr
protected int mBytePtr -
mByteBufferEnd
protected int mByteBufferEnd -
mTmpBuf
protected char[] mTmpBuf
-
-
Constructor Details
-
BambooUTF8Reader
public BambooUTF8Reader(com.ctc.wstx.api.ReaderConfig cfg, InputStream in, byte[] buf, int ptr, int len, boolean recycleBuffer)
-
-
Method Details
-
setXmlCompliancy
public void setXmlCompliancy(int xmlVersion) -
read
- Specified by:
readin classReader- Throws:
IOException
-
canModifyBuffer
protected final boolean canModifyBuffer() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-
read
- Overrides:
readin classReader- Throws:
IOException
-
getStream
-
readBytes
- Throws:
IOException
-
readBytesAt
- Throws:
IOException
-
freeBuffers
public final void freeBuffers() -
reportBounds
- Throws:
IOException
-
reportStrangeStream
- Throws:
IOException
-
reportInvalidXml11
- Throws:
IOException
-