readPacketAtLeast

fun InputStream.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.