readBits

fun readBits(bits: Int, signed: Boolean = false): Long

Reads specified bits from the stream. The bits should be in range 1..64. If signed is true the last bit is interpreted as indicator of sign. Bits order is sequential that means BigEndian byte order for the integers which contain more then one byte.

Throws