Added method converting int to BitSet to BitSetUtils.

This commit is contained in:
Evgeny Gerashchenko
2012-06-14 20:44:05 +04:00
parent 5541488ca0
commit e26d7fb75e
3 changed files with 14 additions and 10 deletions
@@ -35,4 +35,14 @@ public class BitSetUtils {
}
return intValue;
}
public static BitSet toBitSet(int value) {
BitSet bitSet = new BitSet();
int bit = 0;
while (value > 0) {
bitSet.set(bit++, value % 2 == 1);
value >>= 1;
}
return bitSet;
}
}