writeToFile

suspend fun <Error class: unknown class>.writeToFile(file: File): Long

Write the contents of this ByteStream to file and close it

Return

the number of bytes written


suspend fun <Error class: unknown class>.writeToFile(path: Path): Long

Write the contents of this ByteStream to file at the given path

Return

the number of bytes written