Package org.restlet.engine.io
Class ReaderInputStream
java.lang.Object
java.io.InputStream
org.restlet.engine.io.ReaderInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Input stream based on a reader. The implementation relies on the NIO
CharsetEncoder class.- Author:
- Jerome Louvel
-
Constructor Summary
ConstructorsConstructorDescriptionReaderInputStream(Reader reader) Constructor.ReaderInputStream(Reader reader, CharacterSet characterSet) Constructor. -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
ReaderInputStream
Constructor. Uses theCharacterSet.ISO_8859_1character set by default.- Parameters:
reader- The reader to wrap as an input stream.- Throws:
IOException
-
ReaderInputStream
Constructor.- Parameters:
reader- The reader to wrap as an input stream.characterSet- The character set to use for encoding.- Throws:
IOException
-
-
Method Details
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
Closes the wrapped reader.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-