sink

common
abstract fun sink(file: Path): Sink

Returns a sink that writes bytes to file from beginning to end. If file already exists it will be replaced with the new data.

Throws

if file cannot be written. A file cannot be written if its enclosing directory does not exist, if the current process doesn't have access to file, if there's a loop of symbolic links, or if any name is too long.

js
abstract fun sink(file: Path): Sink

Throws