Class ReaderInputStream

java.lang.Object
java.io.InputStream
org.xnio.streams.ReaderInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public final class ReaderInputStream extends InputStream
An input stream which encodes characters into bytes.
  • Constructor Details

    • ReaderInputStream

      public ReaderInputStream(Reader reader)
      Construct a new instance.
      Parameters:
      reader - the reader to encode from
    • ReaderInputStream

      public ReaderInputStream(Reader reader, String charsetName) throws UnsupportedEncodingException
      Construct a new instance.
      Parameters:
      reader - the reader to encode from
      charsetName - the character set name
      Throws:
      UnsupportedEncodingException - if the character set is not supported
    • ReaderInputStream

      public ReaderInputStream(Reader reader, Charset charset)
      Construct a new instance.
      Parameters:
      reader - the reader to encode from
      charset - the character set
    • ReaderInputStream

      public ReaderInputStream(Reader reader, CharsetEncoder encoder)
      Construct a new instance.
      Parameters:
      reader - the reader to encode from
      encoder - the character set encoder
    • ReaderInputStream

      public ReaderInputStream(Reader reader, CharsetEncoder encoder, int bufferSize)
      Construct a new instance.
      Parameters:
      reader - the reader to encode from
      encoder - the character set encoder
      bufferSize - the buffer size to use
  • Method Details