XNIO API 3.0.4.GA

org.xnio.streams
Class ReaderInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.xnio.streams.ReaderInputStream
All Implemented Interfaces:
Closeable

public final class ReaderInputStream
extends InputStream

An input stream which encodes characters into bytes.


Constructor Summary
ReaderInputStream(Reader reader)
          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.
ReaderInputStream(Reader reader, String charsetName)
          Construct a new instance.
 
Method Summary
 int available()
          
 void close()
          
 int read()
          
 int read(byte[] b, int off, int len)
          
 long skip(long n)
          
 String toString()
          Get a string representation of this object.
 
Methods inherited from class java.io.InputStream
mark, markSupported, read, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 Detail

read

public int read()
         throws IOException

Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException

Overrides:
read in class InputStream
Throws:
IOException

skip

public long skip(long n)
          throws IOException

Overrides:
skip in class InputStream
Throws:
IOException

available

public int available()
              throws IOException

Overrides:
available in class InputStream
Throws:
IOException

close

public void close()
           throws IOException

Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException

toString

public String toString()
Get a string representation of this object.

Overrides:
toString in class Object
Returns:
the string

XNIO API 3.0.4.GA

Copyright © 2010 JBoss, a division of Red Hat, Inc.