Package io.ktor.utils.io.nio

Functions

asInput
Link copied to clipboard
fun ReadableByteChannel.asInput(pool: ObjectPool<ChunkBuffer> = ChunkBuffer.Pool): Input
asOutput
Link copied to clipboard
fun WritableByteChannel.asOutput(pool: ObjectPool<ChunkBuffer> = ChunkBuffer.Pool): Output
read
Link copied to clipboard
fun ReadableByteChannel.read(buffer: Buffer): Int
Does the same as ReadableByteChannel.read but to a Buffer instance
fun ReadableByteChannel.read(buffer: IoBuffer): Int
Does the same as ReadableByteChannel.read but to a IoBuffer 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
readPacketAtLeast
Link copied to clipboard
fun ReadableByteChannel.readPacketAtLeast(n: Long): ByteReadPacket
Read a packet of at least n bytes or all remaining.
readPacketAtMost
Link copied to clipboard
fun ReadableByteChannel.readPacketAtMost(n: Long): ByteReadPacket
Read a packet of at most n bytes.
readPacketExact
Link copied to clipboard
fun ReadableByteChannel.readPacketExact(n: Long): ByteReadPacket
Read a packet of exactly n bytes.
write
Link copied to clipboard
fun WritableByteChannel.write(buffer: Buffer): Int
Does the same as WritableByteChannel.write but from a Buffer instance
fun WritableByteChannel.write(buffer: IoBuffer): Int
Does the same as WritableByteChannel.write but from a IoBuffer 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
writePacket
Link copied to clipboard
fun WritableByteChannel.writePacket(p: ByteReadPacket): Boolean
Writes packet to a NIO channel.
fun WritableByteChannel.writePacket(builder: BytePacketBuilder.() -> Unit): ByteReadPacket?
Builds packet and write it to a NIO channel.