Byte Write Channel
interface ByteWriteChannel : ObjectWrapper<ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteWriteChannel>
脚本层对 Ktor io.ktor.utils.io.ByteWriteChannel 的包装。
提供异步、顺序写入字节的通道,不支持并发写(除非文档特别说明)。 所有挂起函数均可在脚本协程作用域内安全调用。
常用步骤
flush 或 flushAndClose 保证数据到达对端。
异常/取消时调用 cancel 立即关闭通道。
Author
M8Test, [email protected], https://m8test.com
See also
io. ktor. utils. io. Byte Write Channel
Functions
Link copied to clipboard
abstract fun also(block: (ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteWriteChannel) -> Unit): ObjectWrapper<ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteWriteChannel>
对 ObjectWrapper
Link copied to clipboard
abstract fun apply(block: ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteWriteChannel.() -> Unit): ObjectWrapper<ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteWriteChannel>
对 ObjectWrapper
Link copied to clipboard
挂起直到缓冲区数据全部刷送到对端,不关闭通道。
Link copied to clipboard
挂起刷新缓冲区并关闭写入端。
Link copied to clipboard
当前通道是否已关闭写入端。
Link copied to clipboard
abstract fun takeIf(predicate: (ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteWriteChannel) -> Boolean): ObjectWrapper<ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteWriteChannel>?
如果 ObjectWrapper
Link copied to clipboard
abstract fun takeUnless(predicate: (ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteWriteChannel) -> Boolean): ObjectWrapper<ERROR CLASS: Symbol not found for io.ktor.utils.io.ByteWriteChannel>?
如果 ObjectWrapper
Link copied to clipboard
abstract fun writeFully(scope: CoroutineScope, data: ByteArray, start: Int, end: Int): Deferred<Unit>
Link copied to clipboard
异步地将一个字符串以 UTF-8 编码写入通道。