net.ontopia.utils
Class ReaderInputStream
java.lang.Object
java.io.InputStream
net.ontopia.utils.ReaderInputStream
- All Implemented Interfaces:
- Closeable
public class ReaderInputStream
- extends InputStream
INTERNAL: An InputStream stream that turns a Reader into an
InputStream given an encoding.
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)
ReaderInputStream
public ReaderInputStream(Reader reader,
String encoding)
throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
read
public int read()
throws IOException
- Specified by:
read
in class InputStream
- Throws:
IOException
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
available
public int available()
throws IOException
- Overrides:
available
in class InputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class InputStream
- Throws:
IOException
Copyright © 2000-2012 Ontopia.