org.apache.tools.ant.util
Class ReaderInputStream
InputStreamorg.apache.tools.ant.util.ReaderInputStream
public class ReaderInputStream
extends InputStream
Adapts a Reader as an InputStream.
Adapted from StringInputStream.
ReaderInputStream(Reader reader)- Construct a
ReaderInputStream
for the specified Reader.
|
ReaderInputStream(Reader reader, String encoding)- Construct a
ReaderInputStream
for the specified Reader,
with the specified encoding.
|
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.
|
ReaderInputStream
public ReaderInputStream(Reader reader)
Construct a ReaderInputStream
for the specified Reader.
reader - Reader. Must not be null.
ReaderInputStream
public ReaderInputStream(Reader reader,
String encoding) Construct a ReaderInputStream
for the specified Reader,
with the specified encoding.
reader - non-null Reader.encoding - non-null String encoding.
available
public int available()
throws IOException- the current number of bytes ready for reading
close
public void close()
throws IOException Closes the Stringreader.
mark
public void mark(int limit)
Marks the read limit of the StringReader.
limit - the maximum limit of bytes that can be read before the
mark position becomes invalid
markSupported
public boolean markSupported()
- false - mark is not supported
read
public int read()
throws IOException Reads from the Reader, returning the same value.
- the value of the next character in the
Reader.
read
public int read(byte[] b,
int off,
int len)
throws IOException Reads from the Reader into a byte array
b - the byte array to read intooff - the offset in the byte arraylen - the length in the byte array to fill
- the actual number read into the byte array, -1 at
the end of the stream
reset
public void reset()
throws IOException Resets the StringReader.
Copyright B) 2000-2006 Apache Software Foundation. All Rights Reserved.