BitSource

class BitSource(bytes: ByteArray)

This provides an easy abstraction to read bits at a time from a sequence of bytes, where the number of bits read is not often a multiple of 8.

This class is thread-safe but not reentrant -- unless the caller modifies the bytes array it passed in, in which case all bets are off.

Constructors

Link copied to clipboard
constructor(bytes: ByteArray)

Functions

Link copied to clipboard
fun available(): Int
Link copied to clipboard
fun readBits(bits: Int): Int