Since a boolean actually takes 1 byte of space , bool[] not the most economical way to represent a bitmap. Sometimes integers and longs are used as a more efficient bit array, but a long one can only contain 64 bits. Is there a more compact way to store tens of millions of bits of arrays in limited memory?
All I need to do with this array is set / clear individual bits and check if some bits are 1 or 0, i.e. the only functions that I need:
void Set(int index, bool value); bool Get(int index);
source share