toBitSet

Transforms rawBytes and wraps into a BitSet. The last numPaddingBits bits are ignored. This is a deep copy and mirrors the bits in every byte to match the native bitset layout where bit any byte indices run in opposite direction. Hence, modifications to the resulting bitset do not affect rawBytes

Note: Tailing zeroes never count towards the length of the bitset

See BitSet for more details on bit string representation vs memory layout.