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:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
toString
Get a string representation of this object.
-