com.ctc.wstx.io
Class BambooUTF8Reader

java.lang.Object
  extended by java.io.Reader
      extended by com.ctc.wstx.io.BambooUTF8Reader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable

public final class BambooUTF8Reader
extends java.io.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
protected static char CONVERT_LSEP_TO
           
protected static char CONVERT_NEL_TO
           
protected  byte[] mBuffer
           
protected  java.io.InputStream mIn
           
protected  int mLength
           
protected  int mPtr
           
protected static char NULL_BYTE
           
protected static char NULL_CHAR
           
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
BambooUTF8Reader(com.ctc.wstx.api.ReaderConfig cfg, java.io.InputStream in, byte[] buf, int ptr, int len, boolean recycleBuffer)
           
 
Method Summary
 void close()
           
 void freeBuffers()
           
 int read()
           
 int read(char[] cbuf, int start, int len)
           
protected  void reportBounds(char[] arg0, int arg1, int arg2)
           
protected  void reportInvalidXml11(int arg0, int arg1, int arg2)
           
protected  void reportStrangeStream()
           
 void setXmlCompliancy(int xmlVersion)
           
 
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

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

mIn

protected java.io.InputStream mIn

mBuffer

protected byte[] mBuffer

mPtr

protected int mPtr

mLength

protected int mLength
Constructor Detail

BambooUTF8Reader

public BambooUTF8Reader(com.ctc.wstx.api.ReaderConfig cfg,
                        java.io.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 java.io.IOException
Specified by:
read in class java.io.Reader
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Reader
Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Overrides:
read in class java.io.Reader
Throws:
java.io.IOException

freeBuffers

public final void freeBuffers()

reportBounds

protected void reportBounds(char[] arg0,
                            int arg1,
                            int arg2)
                     throws java.io.IOException
Throws:
java.io.IOException

reportStrangeStream

protected void reportStrangeStream()
                            throws java.io.IOException
Throws:
java.io.IOException

reportInvalidXml11

protected void reportInvalidXml11(int arg0,
                                  int arg1,
                                  int arg2)
                           throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2012 Atlassian. All Rights Reserved.