Modifier and Type | Field and Description |
---|---|
private final int | |
private int | |
private int | |
private String |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public void | close()
Implements abstract java. Implements java. Closes the stream and releases any system resources associated with it. |
private void | |
public void | mark(int
Limit on the number of characters that may be
read while still preserving the mark. Because
the stream's input comes from a string, there
is no actual limit, so this argument must not
be negative, but is otherwise ignored. readAheadLimit)Overrides java. Marks the present position in the stream. |
public boolean | markSupported()
Overrides java. Tells whether this stream supports the mark() operation, which it does. |
public int | Returns: The character read, or -1 if the end of the stream has been reachedOverrides java. Reads a single character. |
public int | Returns: The number of characters read, or -1 if the end of the stream has been reachedDestination buffer cbuf, int Offset at which to start storing characters off, int Maximum number of characters to read len)Implements abstract java. Reads characters into a portion of an array. |
public boolean | Returns: True if the next read() is guaranteed not to block for inputOverrides java. Tells whether this stream is ready to be read. |
public void | reset()
Overrides java. Resets the stream to the most recent mark, or to the beginning of the string if it has never been marked. |
public long | Returns: The number of characters actually skippedThe number of characters to skip n)Overrides java. Skips characters. |
length | back to summary |
---|---|
private final int length |
mark | back to summary |
---|---|
private int mark |
next | back to summary |
---|---|
private int next |
str | back to summary |
---|---|
private String str |
StringReader | back to summary |
---|---|
public StringReader(String s) Creates a new string reader.
|
close | back to summary |
---|---|
public void close() Implements abstract java. Implements java. Closes the stream and releases any system resources associated with it. Once the stream has been closed, further read(), ready(), mark(), or reset() invocations will throw an IOException. Closing a previously closed stream has no effect. This method will block while there is another thread blocking on the reader. |
ensureOpen | back to summary |
---|---|
private void ensureOpen() throws IOException Check to make sure that the stream has not been closed |
mark | back to summary |
---|---|
public void mark(int readAheadLimit) throws IOException Overrides java. Marks the present position in the stream. Subsequent calls to reset() will reposition the stream to this point.
|
markSupported | back to summary |
---|---|
public boolean markSupported() Overrides java. Tells whether this stream supports the mark() operation, which it does.
|
read | back to summary |
---|---|
public int read() throws IOException Overrides java. Reads a single character.
|
read | back to summary |
---|---|
public int read(char[] cbuf, int off, int len) throws IOException Implements abstract java. Reads characters into a portion of an array. If
|
ready | back to summary |
---|---|
public boolean ready() throws IOException Overrides java. Tells whether this stream is ready to be read.
|
reset | back to summary |
---|---|
public void reset() throws IOException Overrides java. Resets the stream to the most recent mark, or to the beginning of the string if it has never been marked.
|
skip | back to summary |
---|---|
public long skip(long n) throws IOException Overrides java. Skips characters. If the stream is already at its end before this method is invoked, then no characters are skipped and zero is returned. The If the entire string has been read or skipped, then this method has
no effect and always returns
|