List of utility methods to do BitSet Create
BitSet | byte2BitSet(byte[] b, int offset, boolean bitZeroMeansExtended) Converts a binary representation of a Bitmap field into a Java BitSet int len = bitZeroMeansExtended ? ((b[offset] & 0x80) == 0x80 ? 128 : 64) : 64; BitSet bmap = new BitSet(len); for (int i = 0; i < len; i++) if (((b[offset + (i >> 3)]) & (0x80 >> (i % 8))) > 0) bmap.set(i + 1); return bmap; |
BitSet | byte2BitSet(byte[] b, int offset, int maxBits) Converts a binary representation of a Bitmap field into a Java BitSet int len = maxBits > 64 ? ((b[offset] & 0x80) == 0x80 ? 128 : 64) : maxBits; if (maxBits > 128 && b.length > offset + 8 && (b[offset + 8] & 0x80) == 0x80) { len = 192; BitSet bmap = new BitSet(len); for (int i = 0; i < len; i++) { if (((b[offset + (i >> 3)]) & (0x80 >> (i % 8))) > 0) { bmap.set(i + 1); ... |
BitSet | convert(final long value) Converts a given Long to a BitSet. long tmp = value; BitSet bits = new BitSet(); int index = 0; while (tmp != 0L) { if (tmp % 2L != 0) { bits.set(index); ++index; ... |
void | convert(long value, int bitSetOffset, BitSet bits) convert int index = 0; while (value != 0L) { if (value % 2L != 0) { bits.set(bitSetOffset + index); ++index; value = value >>> 1; |
BitSet | convertIntToBitSet(int value) convert Int To Bit Set BitSet bits = new BitSet(); int index = 0; while (value != 0) { if ((value % 2) != 0) { bits.set(index); ++index; value = value >>> 1; ... |