com.ibatis.common.io
Class ReaderInputStream
java.lang.Object
java.io.InputStream
com.ibatis.common.io.ReaderInputStream
- All Implemented Interfaces:
- Closeable
public class ReaderInputStream
- extends InputStream
An InputStream backed by a Reader
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
reader
protected Reader reader
byteArrayOut
protected ByteArrayOutputStream byteArrayOut
writer
protected Writer writer
chars
protected char[] chars
buffer
protected byte[] buffer
index
protected int index
length
protected int length
ReaderInputStream
public ReaderInputStream(Reader reader)
- Constructor to supply a Reader
- Parameters:
reader - - the Reader used by the InputStream
ReaderInputStream
public ReaderInputStream(Reader reader,
String encoding)
throws UnsupportedEncodingException
- Constructor to supply a Reader and an encoding
- Parameters:
reader - - the Reader used by the InputStreamencoding - - the encoding to use for the InputStream
- Throws:
UnsupportedEncodingException - if the encoding is not supported
read
public int read()
throws IOException
- Specified by:
read in class InputStream
- Throws:
IOException- See Also:
InputStream.read()
fillBuffer
protected void fillBuffer()
throws IOException
- Throws:
IOException
read
public int read(byte[] data,
int off,
int len)
throws IOException
- Overrides:
read in class InputStream
- Throws:
IOException- See Also:
InputStream.read(byte[], int, int)
available
public int available()
throws IOException
- Overrides:
available in class InputStream
- Throws:
IOException- See Also:
InputStream.available()
close
public void close()
throws IOException
- Specified by:
close in interface Closeable- Overrides:
close in class InputStream
- Throws:
IOException- See Also:
InputStream.close()
Copyright © 2010. All Rights Reserved.