appendBits

fun appendBits(value: Int, len: Int)

Appends the specified number of low-order bits of the specified value to this buffer. Requires 0 ≤ len ≤ 31 and 0 ≤ val < 2len.

Parameters

value

the value to append

len

the number of low-order bits in the value to take

Throws

if the value or number of bits is out of range

if appending the data would make bitLength exceed Integer.MAX_VALUE