klyn.io.Path.read
method
public read() as String throws IOException
Description

Reads the whole text content of this path.

This helper is intended for small or medium text files. Use FileReader directly when you need streaming, line-by-line processing, or explicit control over the reader lifetime.

Returns

Complete text content of the file.

Throws
  • IOException if this path cannot be opened or read as a file.
Example
import klyn.io

path = Path.tempDir.resolve("notes.txt")
path.write("Hello")
assert path.read() == "Hello"