/** * Creates a new LongBitSet using the provided long[] array as backing store. * The storedBits array must be large enough to accommodate the numBits specified, but may be larger. * In that case the 'extra' or 'ghost' bits must be clear (or they may provoke spurious side-effects) * @param storedBits the array to use as backing store * @param numBits the number of bits actually needed */ public FixedBitSet(long[] storedBits, int numBits) { this.numWords = bits2words(numBits); if (numWords > storedBits.length) { throw new IllegalArgumentException("The given long array is too small to hold " + numBits + " bits"); } this.numBits = numBits; this.bits = storedBits; assert verifyGhostBitsClear(); }
/** * Creates a new LongBitSet using the provided long[] array as backing store. * The storedBits array must be large enough to accommodate the numBits specified, but may be larger. * In that case the 'extra' or 'ghost' bits must be clear (or they may provoke spurious side-effects) * @param storedBits the array to use as backing store * @param numBits the number of bits actually needed */ public FixedBitSet(long[] storedBits, int numBits) { this.numWords = bits2words(numBits); if (numWords > storedBits.length) { throw new IllegalArgumentException("The given long array is too small to hold " + numBits + " bits"); } this.numBits = numBits; this.bits = storedBits; assert verifyGhostBitsClear(); }
/** * Creates a new LongBitSet using the provided long[] array as backing store. * The storedBits array must be large enough to accommodate the numBits specified, but may be larger. * In that case the 'extra' or 'ghost' bits must be clear (or they may provoke spurious side-effects) * @param storedBits the array to use as backing store * @param numBits the number of bits actually needed */ public FixedBitSet(long[] storedBits, int numBits) { this.numWords = bits2words(numBits); if (numWords > storedBits.length) { throw new IllegalArgumentException("The given long array is too small to hold " + numBits + " bits"); } this.numBits = numBits; this.bits = storedBits; assert verifyGhostBitsClear(); }
/** * Creates a new LongBitSet using the provided long[] array as backing store. * The storedBits array must be large enough to accommodate the numBits specified, but may be larger. * In that case the 'extra' or 'ghost' bits must be clear (or they may provoke spurious side-effects) * @param storedBits the array to use as backing store * @param numBits the number of bits actually needed */ public FixedBitSet(long[] storedBits, int numBits) { this.numWords = bits2words(numBits); if (numWords > storedBits.length) { throw new IllegalArgumentException("The given long array is too small to hold " + numBits + " bits"); } this.numBits = numBits; this.bits = storedBits; assert verifyGhostBitsClear(); }