asFlow
Converts the content of an InputStream into a Flow of ByteArrays.
Return
A Flow of ByteArrays representing chunks of content from the input stream.
Example usage:
val inputStream: InputStream = ...
val byteArrayFlow = inputStream.asFlow()
byteArrayFlow.collect { bytes -> ... }
Content copied to clipboard
Parameters
dispatcher
The coroutine dispatcher to be used. Defaults to Dispatchers.IO.