Package org.apache.tools.ant.util
Class ReaderInputStream
java.lang.Object
java.io.InputStream
org.apache.tools.ant.util.ReaderInputStream
- All Implemented Interfaces:
- Closeable,- AutoCloseable
- Direct Known Subclasses:
- StringInputStream
Adapts a 
Reader as an InputStream.
 This is a stripped down version of org.apache.commons.io.input.ReaderInputStream of Apache Commons IO 2.7.
- 
Constructor SummaryConstructorsConstructorDescriptionReaderInputStream(Reader reader) Construct aReaderInputStreamfor the specifiedReader.ReaderInputStream(Reader reader, String encoding) Construct aReaderInputStreamfor the specifiedReader, with the specified encoding.ReaderInputStream(Reader reader, Charset charset) Construct aReaderInputStreamfor the specifiedReader, with the specified encoding.ReaderInputStream(Reader reader, CharsetEncoder encoder) Construct a newReaderInputStream.ReaderInputStream(Reader reader, CharsetEncoder encoder, int bufferSize) Construct a newReaderInputStream.
- 
Method SummaryMethods inherited from class java.io.InputStreamavailable, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
- 
Constructor Details- 
ReaderInputStreamConstruct a newReaderInputStream.- Parameters:
- reader- the target- Reader
- encoder- the charset encoder
- Since:
- 1.10.9
 
- 
ReaderInputStreamConstruct a newReaderInputStream.- Parameters:
- reader- the target- Reader
- encoder- the charset encoder
- bufferSize- the size of the input buffer in number of characters
- Since:
- 1.10.9
 
- 
ReaderInputStreamConstruct aReaderInputStreamfor the specifiedReader.- Parameters:
- reader-- Reader. Must not be- null.
 
- 
ReaderInputStream
- 
ReaderInputStream
 
- 
- 
Method Details- 
readRead the specified number of bytes into an array.- Overrides:
- readin class- InputStream
- Parameters:
- array- the byte array to read into
- off- the offset to start reading bytes into
- len- the number of bytes to read
- Returns:
- the number of bytes read or -1if the end of the stream has been reached
- Throws:
- IOException- if an I/O error occurs
 
- 
readRead the specified number of bytes into an array.- Overrides:
- readin class- InputStream
- Parameters:
- b- the byte array to read into
- Returns:
- the number of bytes read or -1if the end of the stream has been reached
- Throws:
- IOException- if an I/O error occurs
 
- 
readRead a single byte.- Specified by:
- readin class- InputStream
- Returns:
- either the byte read or -1if the end of the stream has been reached
- Throws:
- IOException- if an I/O error occurs
 
- 
closeClose the stream. This method will cause the underlyingReaderto be closed.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- InputStream
- Throws:
- IOException- if an I/O error occurs
 
 
-