| java.lang.Object | ||
| ↳ | java.io.Reader | |
| ↳ | java.io.InputStreamReader | |
Known Direct Subclasses
|
InputStreamReader is class for turning a byte Stream into a character Stream. Data read from the source input stream is converted into characters by either a default or provided character converter. By default, the encoding is assumed to ISO8859_1. The InputStreamReader contains a buffer of bytes read from the source input stream and converts these into characters as needed. The buffer size is 8K.
|
[Expand]
Inherited Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.io.Reader
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new InputStreamReader on the InputStream
in. | |||||||||||
Constructs a new InputStreamReader on the InputStream
in. | |||||||||||
Constructs a new InputStreamReader on the InputStream
in
and CharsetDecoder dec. | |||||||||||
Constructs a new InputStreamReader on the InputStream
in
and Charset charset. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Close this InputStreamReader.
| |||||||||||
Answer the String which identifies the encoding used to convert bytes to
characters.
| |||||||||||
Reads at most
count characters from this Reader and stores
them at offset in the character array buf. | |||||||||||
Reads a single character from this InputStreamReader and returns the
result as an int.
| |||||||||||
Returns a
boolean indicating whether or not this
InputStreamReader is ready to be read without blocking. | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.io.Reader
| |||||||||||
From class java.lang.Object
| |||||||||||
From interface java.io.Closeable
| |||||||||||
From interface java.lang.Readable
| |||||||||||
Constructs a new InputStreamReader on the InputStream in.
Now character reading can be filtered through this InputStreamReader.
This constructor assumes the default conversion of ISO8859_1
(ISO-Latin-1).
| in | the InputStream to convert to characters. |
|---|
Constructs a new InputStreamReader on the InputStream in.
Now character reading can be filtered through this InputStreamReader.
This constructor takes a String parameter enc which is the
name of an encoding. If the encoding cannot be found, an
UnsupportedEncodingException error is thrown.
| in | the InputStream to convert to characters. |
|---|---|
| enc | a String describing the character converter to use. |
| UnsupportedEncodingException | if the encoding cannot be found. |
|---|
Constructs a new InputStreamReader on the InputStream in
and CharsetDecoder dec. Now character reading can be
filtered through this InputStreamReader.
| in | the InputStream to convert to characters |
|---|---|
| dec | a CharsetDecoder used by the character conversion |
Constructs a new InputStreamReader on the InputStream in
and Charset charset. Now character reading can be
filtered through this InputStreamReader.
| in | the InputStream to convert to characters |
|---|---|
| charset | the Charset that specify the character converter |
Close this InputStreamReader. This implementation closes the source InputStream and releases all local storage.
| IOException | If an error occurs attempting to close this InputStreamReader. |
|---|
Answer the String which identifies the encoding used to convert bytes to
characters. The value null is returned if this Reader has
been closed.
Reads at most count characters from this Reader and stores
them at offset in the character array buf.
Returns the number of characters actually read or -1 if the end of reader
was encountered. The bytes are either obtained from converting bytes in
this readers buffer or by first filling the buffer from the source
InputStream and then reading from the buffer.
| buf | character array to store the read characters |
|---|---|
| offset | offset in buf to store the read characters |
| length | maximum number of characters to read |
| IOException | If the InputStreamReader is already closed or some other IO error occurs. |
|---|
Reads a single character from this InputStreamReader and returns the result as an int. The 2 higher-order characters are set to 0. If the end of reader was encountered then return -1. The byte value is either obtained from converting bytes in this readers buffer or by first filling the buffer from the source InputStream and then reading from the buffer.
| IOException | If the InputStreamReader is already closed or some other IO error occurs. |
|---|
Returns a boolean indicating whether or not this
InputStreamReader is ready to be read without blocking. If the result is
true, the next read() will not block. If
the result is false this Reader may or may not block when
read() is sent. This implementation returns
true if there are bytes available in the buffer or the
source InputStream has bytes available.
true if the receiver will not block when
read() is called, false if unknown
or blocking will occur.| IOException | If the InputStreamReader is already closed or some other IO error occurs. |
|---|