Top "Bit-packing" questions

Use this tag for questions related to bit packing, for example packing bits into integer types.

use of the bitwise operators to pack multiple values in one int

Low level bit manipulation has never been my strong point. I will appreciate some help in understanding the following use …

java bitwise-operators packing bit-packing
How to create a byte out of 8 bool values (and vice versa)?

I have 8 bool variables, and I want to "merge" them into a byte. Is there an easy/preferred method to …

c++ boolean bit-manipulation bit-packing
Bit packing of array of integers

I have an array of integers, lets assume they are of type int64_t. Now, I know that only every …

c++ c optimization bit-packing
C++ Data Member Alignment and Array Packing

During a code review I've come across some code that defines a simple structure as follows: class foo { unsigned char …

c++ data-structures packing bit-packing
How to pack arbitrary bit sequence in Python?

I want to encode/compress some binary image data as a sequence if bits. (This sequence will, in general, have …

python memory bit-packing