public long readLong() { this.checkNotClosed(); return this.bytes.readLong(); }
public long readLong() { this.checkNotClosed(); return this.bytes.readLong(); }
public long readLong(long offset) { this.checkNotClosed(); return this.bytes.readLong(offset); }
public T read(Bytes bytes, T tObject) { long i = metadata.start; long end = metadata.start + metadata.length; while (i < end - 7) { UNSAFE.putLong(tObject, i, bytes.readLong()); i += 8; } while (i < end) { UNSAFE.putByte(tObject, i, bytes.readByte()); ++i; } return tObject; }
public long readLong(long offset) { this.checkNotClosed(); return this.bytes.readLong(offset); }
private long readLong(long longIndex) { return bytes.readLong(firstByte(longIndex)); }
private long hash0(Bytes bytes, long offset, long limit) { long h = 0; long i = offset; for (; i < limit - 7; i += 8) h = LONG_LEVEL_PRIME_MULTIPLE * h + bytes.readLong(i); for (; i < limit - 1; i += 2) h = SHORT_LEVEL_PRIME_MULTIPLE * h + bytes.readShort(i); if (i < limit) h = BYTE_LEVEL_PRIME_MULTIPLE * h + bytes.readByte(i); return h; } }
private long hash0(Bytes bytes, long offset, long limit) { long h = 0; long i = offset; for (; i < limit - 7; i += 8) h = LONG_LEVEL_PRIME_MULTIPLE * h + bytes.readLong(i); for (; i < limit - 1; i += 2) h = SHORT_LEVEL_PRIME_MULTIPLE * h + bytes.readShort(i); if (i < limit) h = BYTE_LEVEL_PRIME_MULTIPLE * h + bytes.readByte(i); return h; } }
@Override public boolean clearIfSet(long bitIndex) { long longIndex = longWithThisBit(bitIndex); checkIndex(bitIndex, longIndex); long byteIndex = firstByte(longIndex); long mask = singleBit(bitIndex); long l = bytes.readLong(byteIndex); if ((l & mask) == 0) return false; long l2 = l & ~mask; bytes.writeLong(byteIndex, l2); return true; }
@Override public DirectBitSet flip(long bitIndex) { long longIndex = longWithThisBit(bitIndex); checkIndex(bitIndex, longIndex); long byteIndex = firstByte(longIndex); long mask = singleBit(bitIndex); long l = bytes.readLong(byteIndex); long l2 = l ^ mask; bytes.writeLong(byteIndex, l2); return this; }
@Override public void write(long offset, Bytes bytes) { long length = bytes.remaining(); checkWrite(length); long i; for (i = 0; i < length - 7; i += 8) writeLong(offset + i, bytes.readLong()); for (; i < length; i++) writeByte(offset + i, bytes.readByte()); }
@Override public DirectBitSet clear(long bitIndex) { long longIndex = longWithThisBit(bitIndex); checkIndex(bitIndex, longIndex); long byteIndex = firstByte(longIndex); long mask = singleBit(bitIndex); long l = bytes.readLong(byteIndex); if ((l & mask) == 0) return this; long l2 = l & ~mask; bytes.writeLong(byteIndex, l2); return this; }
@Override public void write(long offset, Bytes bytes) { long length = bytes.remaining(); checkWrite(length); long i; for (i = 0; i < length - 7; i += 8) writeLong(offset + i, bytes.readLong()); for (; i < length; i++) writeByte(offset + i, bytes.readByte()); }
@Override public DirectBitSet clear(long bitIndex) { long longIndex = longWithThisBit(bitIndex); checkIndex(bitIndex, longIndex); long byteIndex = firstByte(longIndex); long mask = singleBit(bitIndex); long l = bytes.readLong(byteIndex); if ((l & mask) == 0) return this; long l2 = l & ~mask; bytes.writeLong(byteIndex, l2); return this; }
@Override public boolean clearIfSet(long bitIndex) { long longIndex = longWithThisBit(bitIndex); checkIndex(bitIndex, longIndex); long byteIndex = firstByte(longIndex); long mask = singleBit(bitIndex); long l = bytes.readLong(byteIndex); if ((l & mask) == 0) return false; long l2 = l & ~mask; bytes.writeLong(byteIndex, l2); return true; }
@Override public DirectBitSet set(long bitIndex) { long longIndex = longWithThisBit(bitIndex); checkIndex(bitIndex, longIndex); long byteIndex = firstByte(longIndex); long mask = singleBit(bitIndex); long l = bytes.readLong(byteIndex); if ((l & mask) != 0) return this; long l2 = l | mask; bytes.writeLong(byteIndex, l2); return this; }
@Override public boolean setIfClear(long bitIndex) { long longIndex = longWithThisBit(bitIndex); checkIndex(bitIndex, longIndex); long byteIndex = firstByte(longIndex); long mask = singleBit(bitIndex); long l = bytes.readLong(byteIndex); long l2 = l | mask; if (l == l2) return false; bytes.writeLong(byteIndex, l2); return true; }
@Override public boolean setIfClear(long bitIndex) { long longIndex = longWithThisBit(bitIndex); checkIndex(bitIndex, longIndex); long byteIndex = firstByte(longIndex); long mask = singleBit(bitIndex); long l = bytes.readLong(byteIndex); long l2 = l | mask; if (l == l2) return false; bytes.writeLong(byteIndex, l2); return true; }
@Override public DirectBitSet flip(long bitIndex) { long longIndex = longWithThisBit(bitIndex); checkIndex(bitIndex, longIndex); long byteIndex = firstByte(longIndex); long mask = singleBit(bitIndex); long l = bytes.readLong(byteIndex); long l2 = l ^ mask; bytes.writeLong(byteIndex, l2); return this; }
@Override public DirectBitSet set(long bitIndex) { long longIndex = longWithThisBit(bitIndex); checkIndex(bitIndex, longIndex); long byteIndex = firstByte(longIndex); long mask = singleBit(bitIndex); long l = bytes.readLong(byteIndex); if ((l & mask) != 0) return this; long l2 = l | mask; bytes.writeLong(byteIndex, l2); return this; }