Package org.xnio.streams
Class ReaderInputStream
java.lang.Object
java.io.InputStream
org.xnio.streams.ReaderInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An input stream which encodes characters into bytes.
-
Constructor Summary
ConstructorsConstructorDescriptionReaderInputStream(Reader reader) Construct a new instance.ReaderInputStream(Reader reader, String charsetName) Construct a new instance.ReaderInputStream(Reader reader, Charset charset) Construct a new instance.ReaderInputStream(Reader reader, CharsetEncoder encoder) Construct a new instance.ReaderInputStream(Reader reader, CharsetEncoder encoder, int bufferSize) Construct a new instance. -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo
-
Constructor Details
-
ReaderInputStream
Construct a new instance.- Parameters:
reader- the reader to encode from
-
ReaderInputStream
Construct a new instance.- Parameters:
reader- the reader to encode fromcharsetName- the character set name- Throws:
UnsupportedEncodingException- if the character set is not supported
-
ReaderInputStream
Construct a new instance.- Parameters:
reader- the reader to encode fromcharset- the character set
-
ReaderInputStream
Construct a new instance.- Parameters:
reader- the reader to encode fromencoder- the character set encoder
-
ReaderInputStream
Construct a new instance.- Parameters:
reader- the reader to encode fromencoder- the character set encoderbufferSize- the buffer size to use
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
toString
Get a string representation of this object.
-