toFlow

fun ByteStream.toFlow(bufferSize: Long = 8192): <Error class: unknown class><ByteArray>

Return a Flow that consumes the underlying ByteStream when collected.

Parameters

bufferSize

the size of the buffers to emit from the flow. All buffers emitted will be of this size except for the last one which may be less than the requested buffer size. This parameter has no effect for the ByteStream.Buffer variant. The emitted ByteArray will be whatever size the in-memory buffer already is in that case.