BufferedByteWriteChannel

Properties

Link copied to clipboard
abstract val closedCause: Throwable?
Link copied to clipboard
Link copied to clipboard
abstract val writeBuffer: Sink

Functions

Link copied to clipboard
Link copied to clipboard
abstract fun cancel(cause: Throwable?)
Link copied to clipboard
Link copied to clipboard
abstract fun close()

Flush all pending bytes from writeBuffer to the internal read buffer without suspension and initiate channel close.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract suspend fun flush()
Link copied to clipboard
abstract suspend fun flushAndClose()
Link copied to clipboard
Link copied to clipboard
abstract fun flushWriteBuffer()

Flush all pending bytes from writeBuffer to the internal read buffer without suspension.

Link copied to clipboard
fun ByteWriteChannel.onClose(onClose: suspend () -> Unit): ByteWriteChannel

Wraps this channel to execute the provided action when closed using flushAndClose().

Link copied to clipboard
suspend fun ByteWriteChannel.write(desiredSpace: Int = 1, block: (ByteArray, Int, Int) -> Int): Int

Await for desiredSpace will be available for write and invoke block function providing Memory instance and the corresponding range suitable for wiring in the memory. The block function should return number of bytes were written, possibly 0.

Link copied to clipboard
suspend fun ByteWriteChannel.writeBuffer(value: RawSource)
Link copied to clipboard
suspend fun ByteWriteChannel.writeByte(value: Byte)
Link copied to clipboard
Link copied to clipboard
suspend fun ByteWriteChannel.writeFully(value: ByteArray, startIndex: Int = 0, endIndex: Int = value.size)
suspend fun ByteWriteChannel.writeFully(value: CPointer<ByteVar>, offset: Int, length: Int)
suspend fun ByteWriteChannel.writeFully(src: CPointer<ByteVar>, offset: Long, length: Long)
Link copied to clipboard
suspend fun ByteWriteChannel.writeInt(value: Int)
Link copied to clipboard
suspend fun ByteWriteChannel.writeLong(value: Long)
Link copied to clipboard
suspend fun ByteWriteChannel.writePacket(copy: Buffer)
suspend fun ByteWriteChannel.writePacket(copy: Source)
Link copied to clipboard
suspend fun ByteWriteChannel.writeShort(value: Short)
Link copied to clipboard
suspend fun ByteWriteChannel.writeSource(source: Source)
Link copied to clipboard
suspend fun ByteWriteChannel.writeString(value: String)
Link copied to clipboard