public final class EncodedInputStream
extends java.io.InputStream
Reader
.
This is an internal class, used to pass readers of characters as streams of
bytes. The characters will be represented according to the specified
encoding. It is up to the caller to ensure the specified encoding is
available, and in general only encodings available as default from Java 1.3
and up should be used.
Currently, the encodings 'UTF8' and 'UTF-16BE' are used.
Streams are obtained by calling the static methods of this class,
for instance createUTF8Stream
.Modifier and Type | Class and Description |
---|---|
(package private) static class |
EncodedInputStream.PublicBufferOutputStream |
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close() |
(package private) static EncodedInputStream |
createUTF16BEStream(java.io.Reader reader)
Create a UTF-16BE encoded stream from the given
Reader . |
static EncodedInputStream |
createUTF8Stream(java.io.Reader reader)
Create a UTF-8 encoded stream from the given
Reader . |
int |
read() |
public static EncodedInputStream createUTF8Stream(java.io.Reader reader)
Reader
.reader
- the Reader
to read characters from.static EncodedInputStream createUTF16BEStream(java.io.Reader reader)
Reader
.reader
- the Reader
to read characters from.public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException