InputStreamReader contains a buffer
of bytes read from the source stream and converts these into characters as
needed. The buffer size is 8K.
OutputStreamWriter
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| pack-priv ByteBuffer | |
| pack-priv CharsetDecoder | |
| private boolean | |
| private InputStream | |
| pack-priv char |
| Access | Constructor and Description |
|---|---|
| public | InputStreamReader(InputStream
the input stream from which to read characters. in)Constructs a new |
| public | InputStreamReader(InputStream
the InputStream from which to read characters. in, final String identifies the character converter to use. enc)Constructs a new InputStreamReader on the InputStream |
| public | InputStreamReader(InputStream
the source InputStream from which to read characters. in, CharsetDecoder the CharsetDecoder used by the character conversion. dec)Constructs a new InputStreamReader on the InputStream |
| public | InputStreamReader(InputStream
the source InputStream from which to read characters. in, Charset the Charset that defines the character converter charset)Constructs a new InputStreamReader on the InputStream |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract java. Implements java. Closes this reader. |
| public String | Returns: the name of the character converter ornull if this
reader is closed.Returns the name of the encoding used to convert bytes into characters. |
| private boolean | |
| public int | Returns: the character read or -1 if the end of the reader has been reached.Overrides java. Reads a single character from this reader and returns it as an integer with the two higher-order bytes set to 0. |
| public int | Returns: the number of characters read or -1 if the end of the reader has been reached.the array to store the characters read. buf, int the initial position in offset, int buf to store the characters
read from this reader.the maximum number of characters to read. length)Implements abstract java. Reads at most |
| public boolean | Returns: true if the receiver will not block when read()
is called, false if unknown or blocking will occur.Overrides java. Indicates whether this reader is ready to be read without blocking. |
| BUFFER_SIZE | back to summary |
|---|---|
| private static final int BUFFER_SIZE | |
| bytes | back to summary |
|---|---|
| pack-priv ByteBuffer bytes | |
| decoder | back to summary |
|---|---|
| pack-priv CharsetDecoder decoder | |
| endOfInput | back to summary |
|---|---|
| private boolean endOfInput | |
| in | back to summary |
|---|---|
| private InputStream in | |
| pending | back to summary |
|---|---|
| pack-priv char pending | |
| InputStreamReader | back to summary |
|---|---|
| public InputStreamReader(InputStream in) Constructs a new
| |
| InputStreamReader | back to summary |
|---|---|
| public InputStreamReader(InputStream in, final String enc) throws UnsupportedEncodingException Constructs a new InputStreamReader on the InputStream
| |
| InputStreamReader | back to summary |
|---|---|
| public InputStreamReader(InputStream in, CharsetDecoder dec) Constructs a new InputStreamReader on the InputStream
| |
| InputStreamReader | back to summary |
|---|---|
| public InputStreamReader(InputStream in, Charset charset) Constructs a new InputStreamReader on the InputStream
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements abstract java. Implements java. Closes this reader. This implementation closes the source InputStream and releases all local storage.
| |
| getEncoding | back to summary |
|---|---|
| public String getEncoding() Returns the name of the encoding used to convert bytes into characters.
The value
| |
| isOpen | back to summary |
|---|---|
| private boolean isOpen() | |
| read | back to summary |
|---|---|
| public int read() throws IOException Overrides java. Reads a single character from this reader and returns it as an integer with the two higher-order bytes set to 0. Returns -1 if the end of the reader has been reached. The byte value is either obtained from converting bytes in this reader's buffer or by first filling the buffer from the source InputStream and then reading from the buffer.
| |
| read | back to summary |
|---|---|
| public int read(char[] buf, int offset, int length) throws IOException Implements abstract java. Reads at most
| |
| ready | back to summary |
|---|---|
| public boolean ready() throws IOException Overrides java. Indicates whether this reader is ready to be read without blocking. If
the result is
| |