klyn.io.FileReader.FileReader
constructor
public FileReader(filePath as Path, encoding as String = "utf-8"):
Description

Creates a reader on the given file path.

Parameters
ParameterDescription
filePathFile path to read from.
encodingText encoding. Only UTF-8 is currently supported.
Throws
  • FileNotFoundException if the file does not exist.
  • IOException if the path is not a regular file.
Example
try reader = FileReader(Path("notes.txt"), encoding="utf-8"):
print(reader.read())