suspend fun ByteChannelSequentialBase.copyTo(
    dst: ByteChannelSequentialBase,
    limit: Long = kotlin.Long.MAX_VALUE
): Long

Deprecated: This is going to become internal. Use ByteReadChannel receiver instead.

suspend expect fun ByteReadChannel.copyTo(
    dst: ByteWriteChannel,
    limit: Long = Long.MAX_VALUE
): Long

Reads up to limit bytes from receiver channel and writes them to dst channel. Closes dst channel if fails to read or write with cause exception.

Return a number of copied bytes