ch.javasoft.io
Class ReaderInputStream
java.lang.Object
java.io.InputStream
ch.javasoft.io.ReaderInputStream
- All Implemented Interfaces:
- Closeable
public class ReaderInputStream
- extends InputStream
Similar to the InputStreamReader as a Reader
reading from an InputStream, this ReaderInputStream
is an InputStream reading from underlying Reader.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReaderInputStream
public ReaderInputStream(Reader reader)
ReaderInputStream
public ReaderInputStream(Reader reader,
String charsetName)
throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
getCharsetName
public String getCharsetName()
- Returns:
- the name of the character set, or null if not specified
allocateBuffer
protected char[] allocateBuffer()
- Returns a default buffer of size 1024.
read
public int read()
throws IOException
- Specified by:
read in class InputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read in class InputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close in interface Closeable- Overrides:
close in class InputStream
- Throws:
IOException