FileReader
classin packageklyn.io
public class FileReader implements TextReader:
FileReader
All Implemented Interfaces: TextReader

Text reader backed by one file.

import klyn.io

try reader = FileReader("README.md"):
print(reader.readLine())
Constructors
Modifier and Type Member Description
public FileReader
FileReader(filePath as Path):
Creates a reader on the given file path.
public FileReader
FileReader(filename as String):
Creates a reader on the given file name.
Methods
Modifier and Type Member Description
public close
close() as Void throws IOException:
Closes the reader.
public readAllText
readAllText() as String throws IOException:
Reads all remaining text from the current reader position.
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.
public static readPrefix
readPrefix(filename as String, maxBytes as Int) as String throws IOException:
Reads at most the first `maxBytes` bytes from a text file.
Methods inherited from TextReader: readAllText, readLine, readLines
Methods inherited from AutoClosable: close