Storing int value of bitmask - extract 1 valued bits

Posted by yankee2905 on Stack Overflow See other posts from Stack Overflow or by yankee2905
Published on 2010-05-28T21:41:22Z Indexed on 2010/05/28 21:52 UTC
Read the original article Hit count: 284

Filed under:
|

I am calculating the int equivalent of a given set of bits and storing that in memory. From there, I would like to determine all 1 value bits from the original bitmask. Example:

33 --> [1,6]
97 --> [1,6,7]

Ideas for an implementation in Java?

© Stack Overflow or respective owner

Related posts about java

Related posts about bitmask