Support bit ordering, bit skipping and byte alignment #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bit ordering: this package now supports writing bits in different
orders. You can indicate if bytes are filled from MSB to LSB (the mode
we had until now) or vice-versa, and you can indicate if words you write
are stored with the MSB first (what we had until now) or with the LSB
first.
Bit skipping: you can now skip a given amount of bits in BitGet and
BitPut. In the latter, bits written are considered undefined (currently
we write zeroes but you shouldn't rely on this).
Byte alignment: you can now skip an undetermined number of bits in
BitGet and BitPut to align the cursor on the next byte. If the cursor is
already on a byte boundary, the cursor doesn't move.
MSB: most-significant bit(s)
LSB: least-significant bit(s)