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

Creates a reader on the given file name.

Parameters
ParameterDescription
filenameFile 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("notes.txt", encoding="utf-8"):
print(reader.read())