DthingApi
|
Public Member Functions | |
InputStreamReader (InputStream in) | |
InputStreamReader (InputStream in, final String enc) throws UnsupportedEncodingException | |
void | close () throws IOException |
String | getEncoding () |
int | read () throws IOException |
int | read (char[] buffer, int offset, int length) throws IOException |
boolean | ready () throws IOException |
void | mark (int readLimit) throws IOException |
boolean | markSupported () |
void | reset () throws IOException |
![]() | |
abstract void | close () throws IOException |
void | mark (int readLimit) throws IOException |
boolean | markSupported () |
int | read () throws IOException |
int | read (char[] buf) throws IOException |
abstract int | read (char[] buf, int offset, int count) throws IOException |
boolean | ready () throws IOException |
void | reset () throws IOException |
long | skip (long charCount) throws IOException |
Additional Inherited Members | |
![]() | |
Reader () | |
Reader (Object lock) | |
![]() | |
Object | lock |
A 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 a provided character converter. The default encoding is taken from the "file.encoding" system property.
contains a buffer of bytes read from the source stream and converts these into characters as needed. The buffer size is 8K.
|
inline |
Constructs a new
on the InputStream
. This constructor sets the character converter to the encoding specified in the "file.encoding" property and falls back to ISO 8859_1 (ISO-Latin-1) if the property doesn't exist.
in | the input stream from which to read characters. |
|
inline |
Constructs a new InputStreamReader on the InputStream
. The character converter that is used to decode bytes into characters is identified by name by
. If the encoding cannot be found, an UnsupportedEncodingException error is thrown.
in | the InputStream from which to read characters. |
enc | identifies the character converter to use. |
NullPointerException | if enc null |
UnsupportedEncodingException | if the encoding specified by enc |
|
inline |
Closes this reader. This implementation closes the source InputStream and releases all local storage.
IOException | if an error occurs attempting to close this reader. |
|
inline |
Returns the historical name of the encoding used by this writer to convert characters to bytes, or null if this writer has been closed. Most callers should probably keep track of the String or Charset they passed in; this method may not return the same name.
|
inline |
Sets a mark position in this reader. The parameter
indicates how many characters can be read before the mark is invalidated. Calling
will reposition the reader back to the marked position if
has not been surpassed.
This default implementation simply throws an
; subclasses must provide their own implementation.
readLimit | the number of characters that can be read before the mark is invalidated. |
IllegalArgumentException | if readLimit < 0 |
IOException | if an error occurs while setting a mark in this reader. |
|
inline |
|
inline |
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.
IOException | if this reader is closed or some other I/O error occurs. |
|
inline |
Reads at most
characters from this reader and stores them at position
in the character array
. Returns the number of characters actually read or -1 if the end of the reader has been reached. The bytes are 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.
buffer | the array to store the characters read. |
offset | the initial position in buf |
length | the maximum number of characters to read. |
IndexOutOfBoundsException | if offset < 0 length < 0 offset + length buf |
IOException | if this reader is closed or some other I/O error occurs. |
|
inline |
Indicates whether this reader is ready to be read without blocking. If the result is
, the next
will not block. If the result is
then this reader may or may not block when
is called. This implementation returns
if there are bytes available in the buffer or the source stream has bytes available.
IOException | if this reader is closed or some other I/O error occurs. |
|
inline |
Resets this reader's position to the last
location. Invocations of
and
will occur from this new location. If this reader has not been marked, the behavior of
is implementation specific. This default implementation throws an
.
IOException | always thrown in this default implementation. |