public class StringReader extends Object implements TextReader:
Text reader backed by an in-memory string.
StringReader is useful for APIs that consume a TextReader, such as XML parsers, without creating a temporary file.
@example `klyn import klyn.io
reader = StringReader("first\nsecond") print(reader.readLine()) print(reader.readAllText())
| Modifier and Type | Member | Description |
|---|---|---|
| public | StringReaderStringReader(text as String): |
Creates a reader over a string. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | closeclose() as Void: |
Closes the reader. |
| public | readAllTextreadAllText() as String throws IOException: |
Reads the remaining text. |
| public | readLinereadLine() as String throws IOException: |
Reads one line from the current reader position. |
| public | readLinesreadLines() as ArrayList<String> throws IOException: |
Reads all remaining lines from the current reader position. |