readBytes

open suspend override fun readBytes(path: Path): ByteArray(source)

Reads the content of a file at the specified path. Bytes are read with Dispatchers.IO context.

Return

The file content as a byte array.

Parameters

path

The path to read.

Throws

if the path doesn't exist or isn't a regular file.

if an I/O error occurs during reading.