split

fun ByteReadChannel.split(coroutineScope: CoroutineScope): Pair<ByteReadChannel, ByteReadChannel>

Split source ByteReadChannel into 2 new ones. Cancel of one channel in split (input or both outputs) cancels other channels.