ktor-io / io.ktor.utils.io.nio / java.nio.channels.ReadableByteChannel / readPacketAtLeast

readPacketAtLeast

fun ReadableByteChannel.readPacketAtLeast(n: Long): ByteReadPacket

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