public void getCharsFromBytes(final long offset, final char[] result, int start, int len) { final int pos = recPtrToIndex(offset); for (int i = 0; i < len; i++) { result[start + i] = (char) (this.fBuffer[pos + i] & 0xff); } }
public short getShort(final long offset) { int idx= recPtrToIndex(offset); return (short) (((this.fBuffer[idx] << 8) | (this.fBuffer[++idx] & 0xff))); }
public short getShort(final long offset) { int idx= recPtrToIndex(offset); return (short) (((this.fBuffer[idx] << 8) | (this.fBuffer[++idx] & 0xff))); }
public void get(final long offset, byte[] data, int dataPos, int len) { int idx = recPtrToIndex(offset); System.arraycopy(this.fBuffer, idx, data, dataPos, len); }
public void get(final long offset, byte[] data, int dataPos, int len) { int idx = recPtrToIndex(offset); System.arraycopy(this.fBuffer, idx, data, dataPos, len); }
public void getChars(final long offset, final char[] result, int start, int len) { final ByteBuffer buf= ByteBuffer.wrap(this.fBuffer); buf.position(recPtrToIndex(offset)); buf.asCharBuffer().get(result, start, len); }
public long getRecPtr(final long offset) { final int idx = recPtrToIndex(offset); return Database.getRecPtr(this.fBuffer, idx); }
public void getChars(final long offset, final char[] result, int start, int len) { final ByteBuffer buf= ByteBuffer.wrap(this.fBuffer); buf.position(recPtrToIndex(offset)); buf.asCharBuffer().get(result, start, len); }
public void putBytes(final long offset, final byte[] bytes) { makeDirty(); System.arraycopy(bytes, 0, this.fBuffer, recPtrToIndex(offset), bytes.length); recordWrite(offset, bytes.length); }
public void putBytes(final long offset, final byte[] bytes) { makeDirty(); System.arraycopy(bytes, 0, this.fBuffer, recPtrToIndex(offset), bytes.length); recordWrite(offset, bytes.length); }
public void putChar(final long offset, final char value) { makeDirty(); int idx= recPtrToIndex(offset); this.fBuffer[idx]= (byte) (value >> 8); this.fBuffer[++idx]= (byte) (value); recordWrite(offset, 2); }
public void putByte(final long offset, final byte value) { makeDirty(); this.fBuffer[recPtrToIndex(offset)]= value; recordWrite(offset, 1); }
public void put3ByteUnsignedInt(final long offset, final int value) { makeDirty(); int idx= recPtrToIndex(offset); this.fBuffer[idx]= (byte) (value >> 16); this.fBuffer[++idx]= (byte) (value >> 8); this.fBuffer[++idx]= (byte) (value); recordWrite(offset, 3); }
public void putCharsAsBytes(final long offset, char[] chars, int start, int len) { makeDirty(); int idx= recPtrToIndex(offset)-1; final int end= start + len; for (int i = start; i < end; i++) { char value= chars[i]; this.fBuffer[++idx]= (byte) (value); } recordWrite(offset, len); }
public void putLong(final long offset, final long value) { makeDirty(); int idx= recPtrToIndex(offset); this.fBuffer[idx]= (byte) (value >> 56); this.fBuffer[++idx]= (byte) (value >> 48); this.fBuffer[++idx]= (byte) (value >> 40); this.fBuffer[++idx]= (byte) (value >> 32); this.fBuffer[++idx]= (byte) (value >> 24); this.fBuffer[++idx]= (byte) (value >> 16); this.fBuffer[++idx]= (byte) (value >> 8); this.fBuffer[++idx]= (byte) (value); recordWrite(offset, 8); }
/** * A Record Pointer is a pointer as returned by Database.malloc(). * This is a pointer to a block + BLOCK_HEADER_SIZE. */ public void putRecPtr(final long offset, final long value) { makeDirty(); int idx = recPtrToIndex(offset); Database.putRecPtr(value, this.fBuffer, idx); recordWrite(offset, 4); }
public void putInt(final long offset, final int value) { makeDirty(); int idx= recPtrToIndex(offset); putInt(value, this.fBuffer, idx); recordWrite(offset, 4); }
/** * A Record Pointer is a pointer as returned by Database.malloc(). * This is a pointer to a block + BLOCK_HEADER_SIZE. */ public void putRecPtr(final long offset, final long value) { makeDirty(); int idx = recPtrToIndex(offset); Database.putRecPtr(value, this.fBuffer, idx); recordWrite(offset, 4); }
void clear(final long offset, final int length) { makeDirty(); int idx = recPtrToIndex(offset); final int end = idx + length; if (end > this.fBuffer.length) { throw new IndexException("Attempting to clear beyond end of chunk. Chunk = " + this.fSequenceNumber //$NON-NLS-1$ + ", offset = " + offset + ", length = " + length); //$NON-NLS-1$//$NON-NLS-2$ } for (; idx < end; idx++) { this.fBuffer[idx] = 0; } recordWrite(offset, length); }
/** * A free Record Pointer is a pointer to a raw block, * i.e. the pointer is not moved past the BLOCK_HEADER_SIZE. */ public void putFreeRecPtr(final long offset, final long value) { makeDirty(); int idx = recPtrToIndex(offset); putInt(compressFreeRecPtr(value), this.fBuffer, idx); recordWrite(offset, 4); }