public class ReaderCharSource extends EmptyCharSource
Constructor and Description |
---|
ReaderCharSource()
make sure to call
setSource() before using
this object. |
ReaderCharSource(java.io.InputStream in) |
ReaderCharSource(java.io.InputStream in,
java.lang.String charsetName)
wraps the
InputStream into a Reader ,
using an encoding for the given character set. |
ReaderCharSource(java.io.Reader in) |
Modifier and Type | Method and Description |
---|---|
int |
read()
returns a single character or -1 to indicate end of file.
|
void |
setSource(java.io.Reader in) |
pop, pop, pushBack
public ReaderCharSource()
setSource()
before using
this object.public ReaderCharSource(java.io.Reader in)
public ReaderCharSource(java.io.InputStream in, java.lang.String charsetName) throws java.io.UnsupportedEncodingException
wraps the InputStream
into a Reader
,
using an encoding for the given character set.
FIX ME: The Reader
used internally cannot be
closed. Anyone who thinks this is a problem, please let me
know. But don't forget to close the InputStream
eventually.
java.io.UnsupportedEncodingException
public ReaderCharSource(java.io.InputStream in)
public int read() throws java.io.IOException
CharSource
read
in interface CharSource
read
in class EmptyCharSource
java.io.IOException
public void setSource(java.io.Reader in)