Package-level declarations

Functions

Link copied to clipboard
fun ReadableByteChannel.asInput(pool: <Error class: unknown class><<Error class: unknown class>> = ChunkBuffer.Pool): <Error class: unknown class>
Link copied to clipboard
fun WritableByteChannel.asOutput(pool: <Error class: unknown class><<Error class: unknown class>> = ChunkBuffer.Pool): <Error class: unknown class>
Link copied to clipboard
fun ReadableByteChannel.read(buffer: <Error class: unknown class>): Int

Does the same as ReadableByteChannel.read but to a Buffer instance

fun ReadableByteChannel.read(destination: Memory, destinationOffset: Int = 0, maxLength: Int = destination.size32 - destinationOffset): Int

Does the same as ReadableByteChannel.read but to a Memory instance

Link copied to clipboard
fun ReadableByteChannel.readPacketAtLeast(n: Long): <Error class: unknown class>

Read a packet of at least n bytes or all remaining. Does fail if not enough bytes remaining. . This function is useless with non-blocking channels

Link copied to clipboard
fun ReadableByteChannel.readPacketAtMost(n: Long): <Error class: unknown class>

Read a packet of at most n bytes. Resulting packet could be empty however this function always reads as much bytes as possible. You also can use it with non-blocking channels

Link copied to clipboard
fun ReadableByteChannel.readPacketExact(n: Long): <Error class: unknown class>

Read a packet of exactly n bytes. This function is useless with non-blocking channels

Link copied to clipboard
fun WritableByteChannel.write(buffer: <Error class: unknown class>): Int

Does the same as WritableByteChannel.write but from a Buffer instance

fun WritableByteChannel.write(source: Memory, sourceOffset: Int = 0, maxLength: Int = source.size32 - sourceOffset): Int

Does the same as WritableByteChannel.write but from a Memory instance

Link copied to clipboard
fun WritableByteChannel.writePacket(p: <Error class: unknown class>): Boolean

Writes packet to a NIO channel. May block if the channel is configured as blocking or may write packet only partially if the channel is non-blocking and there is not enough buffer space.

fun WritableByteChannel.writePacket(builder: <Error class: unknown class>.() -> Unit): <Error class: unknown class>?

Builds packet and write it to a NIO channel. May block if the channel is configured as blocking or may write packet partially so this function returns remaining packet. So for blocking channel this function always returns null.