JBoss Remoting 3.1.0.Beta2

org.jboss.remoting3.stream
Class ReaderInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.jboss.remoting3.stream.ReaderInputStream
All Implemented Interfaces:
Closeable, org.jboss.marshalling.ByteInput

public final class ReaderInputStream
extends InputStream
implements org.jboss.marshalling.ByteInput

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
 
Methods inherited from interface org.jboss.marshalling.ByteInput
read
 

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 interface org.jboss.marshalling.ByteInput
Specified by:
read in class InputStream
Throws:
IOException

read

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

Specified by:
read in interface org.jboss.marshalling.ByteInput
Overrides:
read in class InputStream
Throws:
IOException

skip

public long skip(long n)
          throws IOException

Specified by:
skip in interface org.jboss.marshalling.ByteInput
Overrides:
skip in class InputStream
Throws:
IOException

available

public int available()
              throws IOException

Specified by:
available in interface org.jboss.marshalling.ByteInput
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

JBoss Remoting 3.1.0.Beta2

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