/** * Combine the next 8 bits at the given index with OR. * The index must be a multiple of 8. * * @param i the index * @param x the next 8 bits (0 - 255) */ public void setByte(int i, int x) { int addr = i >> ADDRESS_BITS; checkCapacity(addr); data[addr] |= ((long) x) << (i & (7 << 3)); if (maxLength < i && x != 0) { maxLength = i + 7; } }
/** * Set bit at the given index to 'true'. * * @param i the index */ public void set(int i) { int addr = i >> ADDRESS_BITS; checkCapacity(addr); data[addr] |= getBitMask(i); if (maxLength < i) { maxLength = i; } }