mirai-core / net.mamoe.mirai.utils / kotlinx.coroutines.io.ByteReadChannel / copyAndClose

copyAndClose

suspend fun ByteReadChannel.copyAndClose(dst: OutputStream): Unit
suspend fun ByteReadChannel.copyAndClose(dst: Output): Unit
suspend fun ByteReadChannel.copyAndClose(dst: ByteWriteChannel): Unit
suspend fun ByteReadChannel.copyAndClose(dst: ByteWriteChannel): Unit

从接收者管道读取所有数据并写入 dst, 最终关闭 dst