An InputStreamReader is a bridge from byte streams to character streams: It
reads bytes and translates them into characters according to a specified character encoding. The
encoding that it uses may be specified by name, or the platform's default
encoding may be accepted.
Each invocation of one of an InputStreamReader's read() methods may
cause one or more bytes to be read from the underlying byte-input stream.
To enable the efficient conversion of bytes to characters, more bytes may
be read ahead from the underlying stream than are necessary to satisfy the
current read operation.
For top efficiency, consider wrapping an InputStreamReader within a
BufferedReader. For example:
BufferedReader in
= new BufferedReader(new InputStreamReader(System.in));
Returns the canonical name of the character encoding being used by this
stream. If this InputStreamReader was created with the
InputStreamReader(InputStream, String) constructor then the
returned encoding name, being canonical, may differ from the encoding
name passed to the constructor. May return null if the
stream has been closed.
Returns:
a String representing the encoding name, or possibly
null if the stream has been closed
Tell whether this stream is ready to be read. An InputStreamReader is
ready if its input buffer is not empty, or if bytes are available to be
read from the underlying byte stream.
Submit a bug or feature For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road Palo Alto, California, 94303, U.S.A. All Rights Reserved.