readBytes
Read the specified number of bytes specified (optional, read all remaining by default)
fun ByteReadPacket.readBytes(n: Int = remaining.coerceAtMostMaxIntOrFail("Unable to convert to a ByteArray: packet is too big")): ByteArray
Content copied to clipboard
Read exactly n bytes (consumes all remaining if n is not specified but up to Int.MAX_VALUE bytes). Does fail if not enough bytes remaining.
Reads exactly n bytes from the input or fails if not enough bytes available.
Reads all remaining bytes from the input