writeBytes

abstract suspend fun writeBytes(path: Path, data: ByteArray)(source)

Writes content to a file. If the file doesn't exist, it will be created. If the file exists, its content will be overwritten. Parent directories will be created if they don't exist.

Parameters

path

The path to write to.

data

The data to write as a byte array.

See also

Throws

IOException

if the path is a directory or any other I/O error occurs during writing.