| java.lang.Object java.io.Reader java.io.StringReader
StringReader | public class StringReader extends Reader (Code) | | A character stream whose source is a string.
version: 1.15, 00/02/02 author: Mark Reinhold since: JDK1.1 |
Method Summary | |
public void | close() Close the stream. | public void | mark(int readAheadLimit) Mark the present position in the stream. | public boolean | markSupported() Tell whether this stream supports the mark() operation, which it does. | 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. | public void | reset() Reset the stream to the most recent mark, or to the beginning of the
string if it has never been marked. | public long | skip(long ns) Skip characters. |
StringReader | public StringReader(String s)(Code) | | Create a new string reader.
Parameters: s - String providing the character stream. |
close | public void close()(Code) | | Close the stream.
|
mark | public void mark(int readAheadLimit) throws IOException(Code) | | Mark the present position in the stream. Subsequent calls to reset()
will reposition the stream to this point.
Parameters: readAheadLimit - Limit on the number of characters that may beread while still preserving the mark. Becausethe stream's input comes from a string, thereis no actual limit, so this argument must notbe negative, but is otherwise ignored. exception: IllegalArgumentException - If readAheadLimit is < 0 exception: IOException - If an I/O error occurs |
markSupported | public boolean markSupported()(Code) | | Tell whether this stream supports the mark() operation, which it does.
|
read | public int read() throws IOException(Code) | | Read a single character.
The character read, or -1 if the end of the stream has beenreached 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 writing characters Parameters: len - Maximum number of characters to read The number of characters read, or -1 if the end of thestream 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 exception: IOException - If the stream is closed |
reset | public void reset() throws IOException(Code) | | Reset the stream to the most recent mark, or to the beginning of the
string if it has never been marked.
exception: IOException - If an I/O error occurs |
|
|