@Override public long readVolatileLong() { long l = getChronicleUnsafe().getLongVolatile(null, position); addPosition(8); return l; }
@Override public void writeByte(long offset, int b) { offsetChecks(offset, 1L); getChronicleUnsafe().putByte(start + offset, (byte) b); }
@Override public void writeOrderedLong(long offset, long v) { offsetChecks(offset, 8L); getChronicleUnsafe().putOrderedLong(null, start + offset, v); }
@Override public void writeFloat(long offset, float v) { offsetChecks(offset, 4L); getChronicleUnsafe().putFloat(start + offset, v); }
@Override public void readFully(long offset, byte[] bytes, int off, int len) { checkArrayOffs(bytes.length, off, len); getChronicleUnsafe().copyMemory(null, start + offset, bytes, BYTES_OFFSET + off, len); }
@Override public double readDouble() { double d = getChronicleUnsafe().getDouble(position); addPosition(8); return d; }
@Override public void writeShort(long offset, int v) { offsetChecks(offset, 2L); getChronicleUnsafe().putShort(start + offset, (short) v); }
@Override public void writeChar(int v) { positionChecks(position + 2L); getChronicleUnsafe().putChar(position, (char) v); position += 2L; }
@Override public void writeInt(long offset, int v) { offsetChecks(offset, 4L); getChronicleUnsafe().putInt(start + offset, v); }
@Override public boolean compareAndSwapLong(long offset, long expected, long x) { offsetChecks(offset, 8L); return getChronicleUnsafe().compareAndSwapLong(null, start + offset, expected, x); }
@Override public void writeShort(long offset, int v) { offsetChecks(offset, 2L); //UNSAFE.putShort(startAddr + offset, (short) v); Bits.putShort(startAddr + offset, (short) v); }
@Override public void writeInt(int v) { positionChecks(positionAddr + 4L); //UNSAFE.putInt(positionAddr, v); Bits.putInt(positionAddr, v); positionAddr += 4L; }
@Override public long readIncompleteLong(long offset) { this.checkNotClosed(); return this.bytes.readIncompleteLong(offset); }
@Override public double readDouble() { //double d = UNSAFE.getDouble(positionAddr); double d = Bits.getDouble(positionAddr); addPosition(8); return d; }
@Override public long nextSetBit(long fromIndex) { this.checkNotClosed(); return this.bytes.nextSetBit(fromIndex); } }