This class may be removed in the future. Consider the replacements in JEP 193 'Variable Handles': http://openjdk.java.net/jeps/193
@Override public void putLongLittleEndian(byte[] array, int offset, long value) { theUnsafe.putLong(array, (long) offset + BYTE_ARRAY_BASE_OFFSET, value); } },
static void putLong(byte[] data, int index, long value) { UNSAFE.putLong(data, BYTE_ARRAY_BASE_OFFSET + index, value); }
static void putLong(long address, long value) { UNSAFE.putLong(address, value); }
@Override public void putLongLittleEndian(byte[] array, int offset, long value) { theUnsafe.putLong(array, (long) offset + BYTE_ARRAY_BASE_OFFSET, value); } },
@Override public void putLongLittleEndian(byte[] array, int offset, long value) { // Reverse the order of the bytes before storing, since we're on big-endian hardware. long littleEndianValue = Long.reverseBytes(value); theUnsafe.putLong(array, (long) offset + BYTE_ARRAY_BASE_OFFSET, littleEndianValue); } };
void setLongUnchecked(int index, long value) { unsafe.putLong(base, address + index, value); }
@Override public void putLong(long byteIndex, long l) { unsafe.putLong(baseAdress + byteIndex, l); }
@Override public void putLongLittleEndian(byte[] array, int offset, long value) { theUnsafe.putLong(array, (long) offset + BYTE_ARRAY_BASE_OFFSET, value); } },
@Override public void putLongLittleEndian(byte[] array, int offset, long value) { // Reverse the order of the bytes before storing, since we're on big-endian hardware. long littleEndianValue = Long.reverseBytes(value); theUnsafe.putLong(array, (long) offset + BYTE_ARRAY_BASE_OFFSET, littleEndianValue); } };
public final void setLongValue(Object newObj, long i1) throws IllegalAccessException { if (!isAndroid && memOffset >= 0) { FSTUtil.unFlaggedUnsafe.putLong(newObj, memOffset, i1); return; } field.setLong(newObj, i1); }
public void clear(int offset, int length) { while (length >= SIZE_OF_LONG) { unsafe.putLong(base, address + offset, 0); offset += SIZE_OF_LONG; length -= SIZE_OF_LONG; } while (length > 0) { unsafe.putByte(base, address + offset, (byte) 0); offset++; length--; } }
/** * Initialize (simulate calling the constructor of) the given DirectByteBuffer. */ public static void initDirectByteBuffer( Object dbb, long addr, int cap ) { unsafe.putInt( dbb, directByteBufferMarkOffset, -1 ); unsafe.putInt( dbb, directByteBufferPositionOffset, 0 ); unsafe.putInt( dbb, directByteBufferLimitOffset, cap ); unsafe.putInt( dbb, directByteBufferCapacityOffset, cap ); unsafe.putLong( dbb, directByteBufferAddressOffset, addr ); }
public static void setLong(byte[] bytes, int index, long value) { checkIndexLength(bytes.length, index, SIZE_OF_LONG); unsafe.putLong(bytes, ((long) ARRAY_BYTE_BASE_OFFSET) + index, value); }
@Override public void putLong(long byteIndex, long l) { checkIndex(byteIndex,8); unsafe.putLong(base, off + byteIndex, l); }
@SuppressWarnings("restriction") @Override public void writeLong(long v) throws IOException { if (this.position >= this.buffer.length - 7) { resize(8); } if (LITTLE_ENDIAN) { v = Long.reverseBytes(v); } UNSAFE.putLong(this.buffer, BASE_OFFSET + this.position, v); this.position += 8; }
@SuppressWarnings("restriction") @Override public void writeLong(long v) throws IOException { if (this.position >= this.memory.length - 7) { resize(8); } if (LITTLE_ENDIAN) { v = Long.reverseBytes(v); } UNSAFE.putLong(this.memory, BASE_OFFSET + this.position, v); this.position += 8; }
public static void putLong( long address, long value ) { checkAccess( address, Long.BYTES ); unsafe.putLong( address, value ); }
private static void setRawLong(Slice decimal, int index, long value) { unsafe.putLong(decimal.getBase(), decimal.getAddress() + SIZE_OF_LONG * index, value); }
private static void setRawLong(Slice decimal, int index, long value) { unsafe.putLong(decimal.getBase(), decimal.getAddress() + SIZE_OF_LONG * index, value); }
@SuppressWarnings("restriction") @Override public void writeLong(long v) throws IOException { if (this.position >= this.buffer.length - 7) { resize(8); } if (LITTLE_ENDIAN) { v = Long.reverseBytes(v); } UNSAFE.putLong(this.buffer, BASE_OFFSET + this.position, v); this.position += 8; }