jam1garner/binrw

Bit fields

joelreymont opened this issue · 2 comments

It would be super-helpful to have bit fields like in Deku.

As it stands, I have to create 3 fields to deal with 2 bit fields stored in a 16-bit int:

  1. Two calculated bit fields calculated on read,
  2. A temporary 16-bit field that I read but don't store and that's used to calculated the bit fields,
  3. A bunch of annotations to state what's calculated and skipped on read and write.

Bit fields with both support for both endianness.
bilge may fit the bill :)

Thanks for your report! This looks like a duplicate of #192/#222, so I’d recommend to start there. There is also documentation on how to handle bit fields with modular-bitfield. If you are still having trouble, please open a Q&A that shows the format you are parsing so someone can give a more detailed recommendation. Thanks!