Tutorial by Examples: bitset

Since 1.7 there's a java.util.BitSet class that provides simple and user-friendly bit storage and manipulation interface: final BitSet bitSet = new BitSet(8); // by default all bits are unset IntStream.range(0, 8).filter(i -> i % 2 == 0).forEach(bitSet::set); // {0, 2, 4, 6} bitSet.set(3);...

Page 1 of 1