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
Modifier and TypeFieldDescriptionprotected static final char
protected static final char
protected byte[]
protected int
protected int
protected final com.ctc.wstx.api.ReaderConfig
protected char[]
protected static final char
protected static final char
-
Constructor Summary
ConstructorDescriptionBambooUTF8Reader
(com.ctc.wstx.api.ReaderConfig cfg, InputStream in, byte[] buf, int ptr, int len, boolean recycleBuffer) -
Method Summary
Modifier and TypeMethodDescriptionprotected final boolean
void
close()
final void
protected final InputStream
int
read()
int
read
(char[] cbuf, int start, int len) protected final int
protected final int
readBytesAt
(int arg0) protected void
reportBounds
(char[] arg0, int arg1, int arg2) protected void
reportInvalidXml11
(int arg0, int arg1, int arg2) protected void
void
setXmlCompliancy
(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:
read
in classReader
- Throws:
IOException
-
canModifyBuffer
protected final boolean canModifyBuffer() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classReader
- Throws:
IOException
-
read
- Overrides:
read
in classReader
- Throws:
IOException
-
getStream
-
readBytes
- Throws:
IOException
-
readBytesAt
- Throws:
IOException
-
freeBuffers
public final void freeBuffers() -
reportBounds
- Throws:
IOException
-
reportStrangeStream
- Throws:
IOException
-
reportInvalidXml11
- Throws:
IOException
-