static int bitCount(BitSet bs) { ret bs == null ? 0 : bs.cardinality(); } static int bitCount(int i) { ret Integer.bitCount(i); } static int bitCount(byte[] array) { if (array == null) ret 0; int sum = 0; for (b : array) sum += bitCount(ubyteToInt(b)); ret sum; }