nice solution found to that binary stream problem

October 21st, 2003 at 3:11 pm

I conveniently encapsulated the whole binary stream issue in a BitStream class. A BitStream object may be created, given a filename, and the user can call a get_bits(N) method to get the next N bits from the file (as a string “010101″ etc.) simple and cute. You can read more about it here.

About the implementation - I use the simplest for the moment. When we run into memory problems in our tests, I’ll switch to the buffered approach.

Todo… check out this vec() thingie.

Related posts:

  1. perl bit-crunching
  2. solution to yesterday’s problem
  3. interesting problem (binary representation of big numbers)

Leave a Reply

To post code with preserved formatting, enclose it in `backticks` (even multiple lines)