|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream org.utgenome.util.ReaderInputStream
public class ReaderInputStream
Adapts a Reader
as an InputStream
. Adapted from
StringInputStream
.
Constructor Summary | |
---|---|
ReaderInputStream(Reader reader)
Construct a ReaderInputStream for the specified
Reader . |
|
ReaderInputStream(Reader reader,
Charset charset)
Construct a ReaderInputStream for the specified
Reader , with the specified encoding. |
|
ReaderInputStream(Reader reader,
String encoding)
Construct a ReaderInputStream for the specified
Reader , with the specified encoding. |
Method Summary | |
---|---|
int |
available()
|
void |
close()
Closes the Stringreader. |
void |
mark(int limit)
Marks the read limit of the StringReader. |
boolean |
markSupported()
|
int |
read()
Reads from the Reader , returning the same value. |
int |
read(byte[] b,
int off,
int len)
Reads from the Reader into a byte array |
void |
reset()
Resets the StringReader. |
Methods inherited from class java.io.InputStream |
---|
read, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReaderInputStream(Reader reader)
ReaderInputStream
for the specified
Reader
.
reader
- Reader
. Must not be null
.public ReaderInputStream(Reader reader, String encoding)
ReaderInputStream
for the specified
Reader
, with the specified encoding.
reader
- non-null Reader
.encoding
- non-null String
encoding.public ReaderInputStream(Reader reader, Charset charset)
ReaderInputStream
for the specified
Reader
, with the specified encoding.
reader
- non-null Reader
.encoding
- non-null Charset
Method Detail |
---|
public int read() throws IOException
Reader
, returning the same value.
read
in class InputStream
Reader
.
IOException
- if the original Reader
fails to be readpublic int read(byte[] b, int off, int len) throws IOException
Reader
into a byte array
read
in class InputStream
b
- the byte array to read intooff
- the offset in the byte arraylen
- the length in the byte array to fill
IOException
- if an error occurspublic void mark(int limit)
mark
in class InputStream
limit
- the maximum limit of bytes that can be read before the mark
position becomes invalidpublic int available() throws IOException
available
in class InputStream
IOException
- if an error occurspublic boolean markSupported()
markSupported
in class InputStream
public void reset() throws IOException
reset
in class InputStream
IOException
- if the StringReader fails to be resetpublic void close() throws IOException
close
in interface Closeable
close
in class InputStream
IOException
- if the original StringReader fails to be closed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |