public final class StringReader extends Reader
Reader whose source are Strings. Instances of this class
behave exactly as StringReader instances except that they
never throw IOExceptions. Not thread-safe.| Constructor and Description |
|---|
StringReader(Iterable<String> strings)
Creates a new
StringReader. |
StringReader(String... strings)
Creates a new
StringReader. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
mark(int readLimit)
Marks the current position in the stream.
|
boolean |
markSupported() |
int |
read() |
int |
read(char[] buf) |
int |
read(char[] buf,
int off,
int len) |
boolean |
ready() |
void |
reset()
Resets the stream to the most recent mark, or to the beginning of the
stream if it has never been marked.
|
long |
skip(long n) |
public StringReader(String... strings)
StringReader.strings - the input Strings.NullPointerException - if strings is null or if
it contains a null reference.public StringReader(Iterable<String> strings)
StringReader.strings - the input Strings.NullPointerException - if strings is null or if
it contains a null reference.public boolean markSupported()
markSupported in class Readerpublic void mark(int readLimit)
mark in class ReaderreadLimit - limit on the number of characters that may be read
while still preserving the mark. Because the stream's input
comes from Strings, there is no actual limit, so this
argument must not be negative, but is otherwise ignored.IllegalArgumentException - if readLimit is negative.public void reset()
Copyright © 2012–2015. All rights reserved.