com.ibatis.common.io
Class ReaderInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.ibatis.common.io.ReaderInputStream
所有已实现接口:
java.io.Closeable

public class ReaderInputStream
extends java.io.InputStream

An InputStream backed by a Reader


字段摘要
protected  byte[] buffer
           
protected  java.io.ByteArrayOutputStream byteArrayOut
           
protected  char[] chars
           
protected  int index
           
protected  int length
           
protected  java.io.Reader reader
           
protected  java.io.Writer writer
           
 
构造器摘要
ReaderInputStream(java.io.Reader reader)
          Constructor to supply a Reader
ReaderInputStream(java.io.Reader reader, java.lang.String encoding)
          Constructor to supply a Reader and an encoding
 
方法摘要
 int available()
           
 void close()
           
protected  void fillBuffer()
           
 int read()
           
 int read(byte[] data, int off, int len)
           
 
类方法继承: java.io.InputStream
mark, markSupported, read, reset, skip
 
类方法继承: java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

reader

protected java.io.Reader reader

byteArrayOut

protected java.io.ByteArrayOutputStream byteArrayOut

writer

protected java.io.Writer writer

chars

protected char[] chars

buffer

protected byte[] buffer

index

protected int index

length

protected int length
构造器详细信息

ReaderInputStream

public ReaderInputStream(java.io.Reader reader)
Constructor to supply a Reader

参数:
reader - - the Reader used by the InputStream

ReaderInputStream

public ReaderInputStream(java.io.Reader reader,
                         java.lang.String encoding)
                  throws java.io.UnsupportedEncodingException
Constructor to supply a Reader and an encoding

参数:
reader - - the Reader used by the InputStream
encoding - - the encoding to use for the InputStream
抛出异常:
java.io.UnsupportedEncodingException - if the encoding is not supported
方法详细信息

read

public int read()
         throws java.io.IOException
规范说明:
read in class java.io.InputStream
抛出异常:
java.io.IOException
另请参见:
InputStream.read()

fillBuffer

protected void fillBuffer()
                   throws java.io.IOException
抛出异常:
java.io.IOException

read

public int read(byte[] data,
                int off,
                int len)
         throws java.io.IOException
重写:
read in class java.io.InputStream
抛出异常:
java.io.IOException
另请参见:
InputStream.read(byte[], int, int)

available

public int available()
              throws java.io.IOException
重写:
available in class java.io.InputStream
抛出异常:
java.io.IOException
另请参见:
InputStream.available()

close

public void close()
           throws java.io.IOException
规范说明:
close in interface java.io.Closeable
重写:
close in class java.io.InputStream
抛出异常:
java.io.IOException
另请参见:
InputStream.close()