/** * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to * a multiple of 64. * * @throws NegativeArraySizeException if {@code bitCount < 0}. */ public BitSet(int bitCount) { if (bitCount < 0) { throw new NegativeArraySizeException(Integer.toString(bitCount)); } this.bits = arrayForBits(bitCount); this.longCount = 0; }
/** * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian * sequence of bits. This method does not alter the {@code ByteBuffer}. * @since 1.7 */ public static BitSet valueOf(ByteBuffer byteBuffer) { byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN); long[] longs = arrayForBits(byteBuffer.remaining() * 8); int i = 0; while (byteBuffer.remaining() >= SizeOf.LONG) { longs[i++] = byteBuffer.getLong(); } for (int j = 0; byteBuffer.hasRemaining(); ++j) { longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j)); } return BitSet.valueOf(longs); }
/** * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to * a multiple of 64. * * @throws NegativeArraySizeException if {@code bitCount < 0}. */ public BitSet(int bitCount) { if (bitCount < 0) { throw new NegativeArraySizeException(Integer.toString(bitCount)); } this.bits = arrayForBits(bitCount); this.longCount = 0; }
/** * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to * a multiple of 64. * * @throws NegativeArraySizeException if {@code bitCount < 0}. */ public BitSet(int bitCount) { if (bitCount < 0) { throw new NegativeArraySizeException(Integer.toString(bitCount)); } this.bits = arrayForBits(bitCount); this.longCount = 0; }
/** * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to * a multiple of 64. * * @throws NegativeArraySizeException if {@code bitCount < 0}. */ public BitSet(int bitCount) { if (bitCount < 0) { throw new NegativeArraySizeException(Integer.toString(bitCount)); } this.bits = arrayForBits(bitCount); this.longCount = 0; }
/** * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to * a multiple of 64. * * @throws NegativeArraySizeException if {@code bitCount < 0}. */ public BitSet(int bitCount) { if (bitCount < 0) { throw new NegativeArraySizeException(Integer.toString(bitCount)); } this.bits = arrayForBits(bitCount); this.longCount = 0; }
/** * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to * a multiple of 64. * * @throws NegativeArraySizeException if {@code bitCount < 0}. */ public BitSet(int bitCount) { if (bitCount < 0) { throw new NegativeArraySizeException(Integer.toString(bitCount)); } this.bits = arrayForBits(bitCount); this.longCount = 0; }
/** * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to * a multiple of 64. * * @throws NegativeArraySizeException if {@code bitCount < 0}. */ public BitSet(int bitCount) { if (bitCount < 0) { throw new NegativeArraySizeException(Integer.toString(bitCount)); } this.bits = arrayForBits(bitCount); this.longCount = 0; }
/** * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to * a multiple of 64. * * @throws NegativeArraySizeException if {@code bitCount < 0}. */ public BitSet(int bitCount) { if (bitCount < 0) { throw new NegativeArraySizeException(Integer.toString(bitCount)); } this.bits = arrayForBits(bitCount); this.longCount = 0; }
/** * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian * sequence of bits. This method does not alter the {@code ByteBuffer}. * @since 1.7 */ public static BitSet valueOf(ByteBuffer byteBuffer) { byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN); long[] longs = arrayForBits(byteBuffer.remaining() * 8); int i = 0; while (byteBuffer.remaining() >= SizeOf.LONG) { longs[i++] = byteBuffer.getLong(); } for (int j = 0; byteBuffer.hasRemaining(); ++j) { longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j)); } return BitSet.valueOf(longs); }
/** * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian * sequence of bits. This method does not alter the {@code ByteBuffer}. * @since 1.7 */ public static BitSet valueOf(ByteBuffer byteBuffer) { byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN); long[] longs = arrayForBits(byteBuffer.remaining() * 8); int i = 0; while (byteBuffer.remaining() >= SizeOf.LONG) { longs[i++] = byteBuffer.getLong(); } for (int j = 0; byteBuffer.hasRemaining(); ++j) { longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j)); } return BitSet.valueOf(longs); }
/** * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian * sequence of bits. This method does not alter the {@code ByteBuffer}. * @since 1.7 */ public static BitSet valueOf(ByteBuffer byteBuffer) { byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN); long[] longs = arrayForBits(byteBuffer.remaining() * 8); int i = 0; while (byteBuffer.remaining() >= SizeOf.LONG) { longs[i++] = byteBuffer.getLong(); } for (int j = 0; byteBuffer.hasRemaining(); ++j) { longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j)); } return BitSet.valueOf(longs); }
/** * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian * sequence of bits. This method does not alter the {@code ByteBuffer}. * @since 1.7 */ public static BitSet valueOf(ByteBuffer byteBuffer) { byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN); long[] longs = arrayForBits(byteBuffer.remaining() * 8); int i = 0; while (byteBuffer.remaining() >= SizeOf.LONG) { longs[i++] = byteBuffer.getLong(); } for (int j = 0; byteBuffer.hasRemaining(); ++j) { longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j)); } return BitSet.valueOf(longs); }
/** * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian * sequence of bits. This method does not alter the {@code ByteBuffer}. * @since 1.7 */ public static BitSet valueOf(ByteBuffer byteBuffer) { byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN); long[] longs = arrayForBits(byteBuffer.remaining() * 8); int i = 0; while (byteBuffer.remaining() >= SizeOf.LONG) { longs[i++] = byteBuffer.getLong(); } for (int j = 0; byteBuffer.hasRemaining(); ++j) { longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j)); } return BitSet.valueOf(longs); }
/** * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian * sequence of bits. This method does not alter the {@code ByteBuffer}. * @since 1.7 */ public static BitSet valueOf(ByteBuffer byteBuffer) { byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN); long[] longs = arrayForBits(byteBuffer.remaining() * 8); int i = 0; while (byteBuffer.remaining() >= SizeOf.LONG) { longs[i++] = byteBuffer.getLong(); } for (int j = 0; byteBuffer.hasRemaining(); ++j) { longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j)); } return BitSet.valueOf(longs); }
/** * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian * sequence of bits. This method does not alter the {@code ByteBuffer}. * @since 1.7 */ public static BitSet valueOf(ByteBuffer byteBuffer) { byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN); long[] longs = arrayForBits(byteBuffer.remaining() * 8); int i = 0; while (byteBuffer.remaining() >= SizeOf.LONG) { longs[i++] = byteBuffer.getLong(); } for (int j = 0; byteBuffer.hasRemaining(); ++j) { longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j)); } return BitSet.valueOf(longs); }