writeFrom
suspend fun Path.writeFrom(content: Flow<ByteArray>, vararg options: OpenOption = arrayOf(
StandardOpenOption.WRITE,
StandardOpenOption.CREATE,
))
Writes the content from a given Flow of ByteArrays to the file at this Path, starting at the beginning.
Parameters
content
The Flow of ByteArrays to be written to the file.
options
The options specifying how the file is opened. Defaults to StandardOpenOption.WRITE and StandardOpenOption.CREATE.
Example usage:
val filePath: Path = ...
val byteArrayFlow: Flow<ByteArray> = ...
filePath.writeFrom(byteArrayFlow)
Content copied to clipboard