lunixbochs / struc

Better binary packing for Go
MIT License
572 stars 45 forks source link

How are booleans packed? #27

Open quantum1423 opened 9 years ago

quantum1423 commented 9 years ago

Are booleans packed as individual bits? Or do they take up a whole byte?

lunixbochs commented 9 years ago

I believe booleans are packed as one byte with a single bit set.

If you need individual bits, the bitfield support issue is relevant: https://github.com/lunixbochs/struc/issues/7