public class FileReader implements TextReader:
Text reader backed by one file.
import klyn.io
try reader = FileReader("README.md"):
print(reader.readLine())| Modifier and Type | Member | Description |
|---|---|---|
| public | FileReaderFileReader(filePath as Path): |
Creates a reader on the given file path. |
| public | FileReaderFileReader(filename as String): |
Creates a reader on the given file name. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | closeclose() as Void throws IOException: |
Closes the reader. |
| public | readAllTextreadAllText() as String throws IOException: |
Reads all remaining text from the current reader position. |
| 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. |
| public static | readPrefixreadPrefix(filename as String, maxBytes as Int) as String throws IOException: |
Reads at most the first `maxBytes` bytes from a text file. |