toByteReadChannel

fun InputStream.toByteReadChannel(pool: ObjectPool<ByteBuffer> = KtorDefaultPool, context: CoroutineContext = Dispatchers.Unconfined, parent: Job = Job()): ByteReadChannel

Deprecated

Use variant from 'ktor-io' module instead

Replace with

import io.ktor.utils.io.jvm.javaio.toByteReadChannel
this.toByteReadChannel(context + parent, pool)

Open a channel and launch a coroutine to copy bytes from the input stream to the channel. Please note that it may block your async code when started on Dispatchers.Unconfined since InputStream is blocking on it's nature