java.io
Class InputStreamReader
java.lang.Object
java.io.Reader
java.io.InputStreamReader
public class InputStreamReader
- extends Reader
|
Method Summary |
void |
close()
Close this Reader. |
int |
read(char[] cbuf,
int off,
int len)
Reads at most count characters from this Reader and stores
them at offset in the character array buf. |
InputStreamReader
public InputStreamReader(InputStream in)
InputStreamReader
public InputStreamReader(InputStream in,
String charsetName)
read
public int read(char[] cbuf,
int off,
int len)
throws IOException
- Description copied from class:
Reader
- 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.
- Specified by:
read in class Reader
- Parameters:
cbuf - character array to store the read charactersoff - offset in buf to store the read characterslen - how many characters should be read in
- Returns:
- how many characters were successfully read in or else -1 if the
end of the reader was detected.
- Throws:
IOException - If the Reader is already closed or some other IO error
occurs.
close
public void close()
throws IOException
- Description copied from class:
Reader
- Close this Reader. This must be implemented by any concrete subclasses.
The implementation should free any resources associated with the Reader.
- Specified by:
close in class Reader
- Throws:
IOException - If an error occurs attempting to close this Reader.