StringReader
classin packageklyn.io
public class StringReader extends Object implements TextReader
└ StringReader
All Implemented Interfaces: 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
import klyn.io

reader = StringReader("first\nsecond")
print(reader.readLine())
print(reader.readAllText())
Inherited Properties
propertyInherited Properties from Object: type
Constructors
Modifier and Type Member Description
public StringReader Creates a reader over a string.
Methods
Modifier and Type Member Description
public close
close() as Void
Closes the reader.
public readAllText
readAllText() as String throws IOException
Reads the remaining text.
public readLine
readLine() as String throws IOException
Reads one line from the current reader position.
public readLines
readLines() as ArrayList<String> throws IOException
Reads all remaining lines from the current reader position.
Inherited Methods
methodInherited Methods from Object: deepCopy, fromJson, hash, toDict, toJson, toMap, toString, toXml
methodInherited Methods from AutoClosable: close