dynamic_bitset boost for large dataset

157 Views Asked by At

I am writing a very big data to file, it is the result of the Huffman encoding which I need to save to a file and read it later. I came across the idea of using dynamic_bitset for handling the bits. I have tested my code on small data and it works fine but on a bigger data (encoding an image) it fails and crashes. This is how the variable that I'm trying to save looks like:

_encodedSig {m_bits={ size=46944 } m_num_bits=1502195 } boost::dynamic_bitset<unsigned long,std::allocator<unsigned long> > &

However, when I use the function size() it returns 16 which is confusing for me. I tried testing to convert it to unsigned long but it throws an exception. I wonder how much data can dynamic bit_set handle and why the m_num_bits is not equal to size(). I will appreciate any thoughts and ideas.

0

There are 0 best solutions below