readText

Returns the contents of the file at path decoded as UTF-8. Malformed byte sequences become the replacement character U+FFFD.

A relative path resolves against basePath; an absolute one is used as given.

Has no sample because it needs a file on disk.

Throws

if the file does not exist, cannot be read, or is larger than Int.MAX_VALUE bytes.