I am looking for a c++ std::bitset equivalent or a similar functionality implementation in Java (1.6 specifically). I tried java.util.BitSet but I am finding that it is not quite similar.
The operations I need are the usual bitwise operations such as AND, OR, etc. If possible, I’d like to be able to set the length of the bitset dynamically (which is unsupported in std::bitset). Can anyone provide a recommendation? Thanks.
I don’t see what problem you’d have with the normal Bitset class.
The bitset is dynamically grown if necessary (with length() returning the pos of the higehst one bit), so that’s basically a fool proof solution.