org.restlet.engine.io
Class ReaderInputStream
java.lang.Object
java.io.InputStream
org.restlet.engine.io.ReaderInputStream
- All Implemented Interfaces:
- Closeable
public class ReaderInputStream
- extends InputStream
Input stream based on a reader. The implementation relies on the NIO
CharsetEncoder class.
- Author:
- Jerome Louvel
|
Method Summary |
int |
available()
|
void |
close()
Closes the wrapped reader. |
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReaderInputStream
public ReaderInputStream(Reader reader)
throws IOException
- Constructor. Uses the
CharacterSet.ISO_8859_1 character set by
default.
- Parameters:
reader - The reader to wrap as an input stream.
- Throws:
IOException
ReaderInputStream
public ReaderInputStream(Reader reader,
CharacterSet characterSet)
throws IOException
- Constructor.
- Parameters:
reader - The reader to wrap as an input stream.characterSet - The character set to use for encoding.
- Throws:
IOException
available
public int available()
throws IOException
- Overrides:
available in class InputStream
- Throws:
IOException
close
public void close()
throws IOException
- Closes the wrapped reader.
- Specified by:
close in interface Closeable- Overrides:
close in class InputStream
- Throws:
IOException
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
Copyright © 2005-2014 Restlet.