| java.lang.Object java.io.Reader java.io.InputStreamReader
All known Subclasses: java.io.FileReader,
InputStreamReader | public class InputStreamReader extends Reader (Code) | | An InputStreamReader is a bridge from byte streams to character streams:
It reads bytes and translates them into characters.
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.
version: 12/17/01 (CLDC 1.1) See Also: java.io.Reader See Also: java.io.UnsupportedEncodingException since: CLDC 1.0 |
Method Summary | |
public void | close() Close the stream. | public void | mark(int readAheadLimit) Mark the present position in the stream.
Parameters: readAheadLimit - Limit on the number of characters that may beread while still preserving the mark. | public boolean | markSupported() Tell whether this stream supports the mark() operation. | public int | read() Read a single character. | public int | read(char cbuf, int off, int len) Read characters into a portion of an array. | public boolean | ready() Tell whether this stream is ready to be read.
True if the next read() is guaranteed not to block for input,false otherwise. | public void | reset() Reset the stream. | public long | skip(long n) Skip characters. |
InputStreamReader | public InputStreamReader(InputStream is)(Code) | | Create an InputStreamReader that uses the default character encoding.
Parameters: is - An InputStream |
close | public void close() throws IOException(Code) | | Close the stream. Closing a previously closed stream
has no effect.
exception: IOException - If an I/O error occurs |
mark | public void mark(int readAheadLimit) throws IOException(Code) | | Mark the present position in the stream.
Parameters: readAheadLimit - Limit on the number of characters that may beread while still preserving the mark. Afterreading this many characters, attempting toreset the stream may fail. exception: IOException - If the stream does not support mark(),or if some other I/O error occurs |
markSupported | public boolean markSupported()(Code) | | Tell whether this stream supports the mark() operation.
true if and only if this stream supports the mark operation. |
read | public int read() throws IOException(Code) | | Read a single character.
The character read, or -1 if the end of the stream hasbeen reached exception: IOException - If an I/O error occurs |
read | public int read(char cbuf, int off, int len) throws IOException(Code) | | Read characters into a portion of an array.
Parameters: cbuf - Destination buffer Parameters: off - Offset at which to start storing characters Parameters: len - Maximum number of characters to read The number of characters read, or -1 if the end ofthe stream has been reached exception: IOException - If an I/O error occurs |
ready | public boolean ready() throws IOException(Code) | | Tell whether this stream is ready to be read.
True if the next read() is guaranteed not to block for input,false otherwise. Note that returning false does not guarantee that thenext read will block. exception: IOException - If an I/O error occurs |
skip | public long skip(long n) throws IOException(Code) | | Skip characters.
Parameters: n - The number of characters to skip The number of characters actually skipped exception: IllegalArgumentException - If n is negative. exception: IOException - If an I/O error occurs |
|
|