Byte Read Channel
interface ByteReadChannel : ObjectWrapper<ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteReadChannel>
用于异步读取字节序列的通道。
该接口是对 Ktor 原始 io.ktor.utils.io.ByteReadChannel 的封装, 用于在脚本环境中提供非阻塞的IO读取能力。
这是一个 单读取者通道,意味着不应在多个协程中并发地从此通道读取数据。
Author
M8Test, [email protected], https://m8test.com
Functions
Link copied to clipboard
abstract fun also(block: (ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteReadChannel) -> Unit): ObjectWrapper<ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteReadChannel>
对 ObjectWrapper
Link copied to clipboard
abstract fun apply(block: ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteReadChannel.() -> Unit): ObjectWrapper<ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteReadChannel>
对 ObjectWrapper
Link copied to clipboard
abstract fun copyToByteWriteChannel(scope: CoroutineScope, byteWriteChannel: ByteWriteChannel, limit: Long?): Deferred<Long>
异步地将此通道中的字节复制到目标 byteWriteChannel 中.
Link copied to clipboard
abstract fun copyToByteWriteChannelAndClose(scope: CoroutineScope, byteWriteChannel: ByteWriteChannel): Deferred<Long>
异步地将此通道中所有剩余的字节复制到目标 byteWriteChannel 中,并在完成后关闭两个通道。
Link copied to clipboard
检查通道是否已对读取操作关闭。
Link copied to clipboard
abstract fun readAvailable(scope: CoroutineScope, buffer: ByteArray, offset: Int, length: Int): Deferred<Int>
异步地将通道中当前可用的字节读入指定的字节数组.
Link copied to clipboard
异步读取并返回通道中的下一个字节。
Link copied to clipboard
异步读取并返回一个包含确切 count 字节的字节数组。
Link copied to clipboard
异步读取四个字节并将其作为 Int (大端序) 返回。
Link copied to clipboard
异步读取此通道中所有剩余的字节。
Link copied to clipboard
以冷流(Cold Flow)的形式返回一个字节块序列,用于流式读取此通道的数据。
Link copied to clipboard
异步读取一行 UTF-8 编码的文本。 识别 CR, LF, CRLF 作为行分隔符。
Link copied to clipboard
abstract fun takeIf(predicate: (ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteReadChannel) -> Boolean): ObjectWrapper<ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteReadChannel>?
如果 ObjectWrapper
Link copied to clipboard
abstract fun takeUnless(predicate: (ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteReadChannel) -> Boolean): ObjectWrapper<ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteReadChannel>?
如果 ObjectWrapper