本文整理了Java中sun.misc.Unsafe.getLong()
方法的一些代码示例,展示了Unsafe.getLong()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Unsafe.getLong()
方法的具体详情如下:
包路径:sun.misc.Unsafe
类名称:Unsafe
方法名:getLong
暂无
代码示例来源:origin: google/guava
@Override
public long getLongLittleEndian(byte[] array, int offset) {
return theUnsafe.getLong(array, (long) offset + BYTE_ARRAY_BASE_OFFSET);
}
代码示例来源:origin: netty/netty
static long getLong(byte[] data, int index) {
return UNSAFE.getLong(data, BYTE_ARRAY_BASE_OFFSET + index);
}
代码示例来源:origin: netty/netty
private static long getLong(Object object, long fieldOffset) {
return UNSAFE.getLong(object, fieldOffset);
}
代码示例来源:origin: netty/netty
static long getLong(long address) {
return UNSAFE.getLong(address);
}
代码示例来源:origin: google/guava
@Override
public long getLongLittleEndian(byte[] array, int offset) {
long bigEndian = theUnsafe.getLong(array, (long) offset + BYTE_ARRAY_BASE_OFFSET);
// The hardware is big-endian, so we need to reverse the order of the bytes.
return Long.reverseBytes(bigEndian);
}
代码示例来源:origin: prestodb/presto
long getLongUnchecked(int index)
{
return unsafe.getLong(base, address + index);
}
代码示例来源:origin: prestodb/presto
@Override
public long getLongLittleEndian(byte[] array, int offset) {
return theUnsafe.getLong(array, (long) offset + BYTE_ARRAY_BASE_OFFSET);
}
代码示例来源:origin: redisson/redisson
@Override
public long getLong(long byteIndex) {
return unsafe.getLong(baseAdress + byteIndex);
}
代码示例来源:origin: neo4j/neo4j
/**
* Read the value of the address field in the (assumed to be) DirectByteBuffer.
* <p>
* <strong>NOTE:</strong> calling this method on a non-direct ByteBuffer is undefined behaviour.
*
* @param dbb The direct byte buffer to read the address field from.
* @return The native memory address in the given direct byte buffer.
*/
public static long getDirectByteBufferAddress( ByteBuffer dbb )
{
return unsafe.getLong( dbb, directByteBufferAddressOffset );
}
代码示例来源:origin: redisson/redisson
public final long getLongValueUnsafe(Object obj) throws IllegalAccessException {
return FSTUtil.unFlaggedUnsafe.getLong(obj, memOffset);
}
代码示例来源:origin: redisson/redisson
private static long getLong(Object object, long fieldOffset) {
return UNSAFE.getLong(object, fieldOffset);
}
代码示例来源:origin: redisson/redisson
static long getLong(byte[] data, int index) {
return UNSAFE.getLong(data, BYTE_ARRAY_BASE_OFFSET + index);
}
代码示例来源:origin: prestodb/presto
@Override
public long getLongLittleEndian(byte[] array, int offset) {
long bigEndian = theUnsafe.getLong(array, (long) offset + BYTE_ARRAY_BASE_OFFSET);
// The hardware is big-endian, so we need to reverse the order of the bytes.
return Long.reverseBytes(bigEndian);
}
代码示例来源:origin: redisson/redisson
public final long getLongValue(Object obj) throws IllegalAccessException {
if (!isAndroid && memOffset >= 0) {
return FSTUtil.unFlaggedUnsafe.getLong(obj, memOffset);
}
return field.getLong(obj);
}
代码示例来源:origin: prestodb/presto
public static long getLong(byte[] bytes, int index)
{
checkIndexLength(bytes.length, index, SIZE_OF_LONG);
return unsafe.getLong(bytes, ((long) ARRAY_BYTE_BASE_OFFSET) + index);
}
代码示例来源:origin: redisson/redisson
@Override
public long getLong(long byteIndex) {
checkIndex(byteIndex,8);
return unsafe.getLong(base, off + byteIndex);
}
代码示例来源:origin: apache/incubator-druid
public static long getAddress(ByteBuffer buf)
{
return UNSAFE.getLong(buf, ADDRESS_OFFSET);
}
代码示例来源:origin: neo4j/neo4j
public static long getLong( long address )
{
checkAccess( address, Long.BYTES );
return unsafe.getLong( address );
}
代码示例来源:origin: prestodb/presto
private static long getRawLong(Slice decimal, int index)
{
return unsafe.getLong(decimal.getBase(), decimal.getAddress() + SIZE_OF_LONG * index);
}
代码示例来源:origin: prestodb/presto
private static long getRawLong(Slice decimal, int index)
{
return unsafe.getLong(decimal.getBase(), decimal.getAddress() + SIZE_OF_LONG * index);
}
内容来源于网络,如有侵权,请联系作者删除!