sun.misc.Unsafe.getDouble()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(90)

本文整理了Java中sun.misc.Unsafe.getDouble()方法的一些代码示例,展示了Unsafe.getDouble()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Unsafe.getDouble()方法的具体详情如下:
包路径:sun.misc.Unsafe
类名称:Unsafe
方法名:getDouble

Unsafe.getDouble介绍

暂无

代码示例

代码示例来源:origin: redisson/redisson

@Override
public double getDouble(long byteIndex) {
  return unsafe.getDouble(baseAdress + byteIndex);
}

代码示例来源:origin: neo4j/neo4j

public static double getDouble( Object obj, long offset )
{
  return unsafe.getDouble( obj, offset );
}

代码示例来源:origin: apache/ignite

/**
 * Gets double value from object field.
 *
 * @param obj Object.
 * @param fieldOff Field offset.
 * @return Double value from object field.
 */
public static double getDoubleField(Object obj, long fieldOff) {
  return UNSAFE.getDouble(obj, fieldOff);
}

代码示例来源:origin: bytedeco/javacpp

@Override double getDouble(byte[] array, long offset) { return UNSAFE.getDouble(array, arrayOffset + offset); }
@Override void putDouble(byte[] array, long offset, double d) { UNSAFE.putDouble(array, arrayOffset + offset, d); }

代码示例来源:origin: com.google.protobuf/protobuf-java

@Override
public double getDouble(Object target, long offset) {
 return unsafe.getDouble(target, offset);
}

代码示例来源:origin: peter-lawrey/Java-Chronicle

@Override
public double readDouble() {
  double d = UNSAFE.getDouble(position);
  position += 8;
  return d;
}

代码示例来源:origin: bytedeco/javacpp

@Override double getDouble(long address) { return UNSAFE.getDouble(address); }
@Override void putDouble(long address, double d) { UNSAFE.putDouble(address, d); }

代码示例来源:origin: prestodb/presto

public static double getDouble(byte[] bytes, int index)
{
  checkIndexLength(bytes.length, index, SIZE_OF_DOUBLE);
  return unsafe.getDouble(bytes, ((long) ARRAY_BYTE_BASE_OFFSET) + index);
}

代码示例来源:origin: redisson/redisson

@Override
public double getDouble(long byteIndex) {
  checkIndex(byteIndex,8);
  return unsafe.getDouble(base, off + byteIndex);
}

代码示例来源:origin: redisson/redisson

public final double getDoubleValue(Object obj) throws IllegalAccessException {
  if (!isAndroid && memOffset >= 0) {
    return FSTUtil.unFlaggedUnsafe.getDouble(obj, memOffset);
  }
  return field.getDouble(obj);
}

代码示例来源:origin: prestodb/presto

/**
 * Gets a 64-bit double at the specified absolute {@code index} in
 * this buffer.
 *
 * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or
 * {@code index + 8} is greater than {@code this.length()}
 */
public double getDouble(int index)
{
  checkIndexLength(index, SIZE_OF_DOUBLE);
  return unsafe.getDouble(base, address + index);
}

代码示例来源:origin: neo4j/neo4j

public static double getDouble( long address )
{
  checkAccess( address, Double.BYTES );
  return unsafe.getDouble( address );
}

代码示例来源:origin: apache/ignite

/**
 * Gets double value from byte array. Alignment aware.
 *
 * @param arr byte array.
 * @param off Offset.
 * @return Double value from byte array. Alignment aware.
 */
public static double getDouble(byte[] arr, long off) {
  return UNALIGNED ? UNSAFE.getDouble(arr, off) : Double.longBitsToDouble(getLongByByte(arr, off, BIG_ENDIAN));
}

代码示例来源:origin: apache/ignite

/**
 * Gets double value from given address. Alignment aware.
 *
 * @param addr Address.
 * @return Double value from given address.
 */
public static double getDouble(long addr) {
  return UNALIGNED ? UNSAFE.getDouble(addr) : Double.longBitsToDouble(getLongByByte(addr, BIG_ENDIAN));
}

代码示例来源:origin: real-logic/agrona

public double getDouble(final int index)
{
  boundsCheck0(index, SIZE_OF_DOUBLE);
  return UNSAFE.getDouble(byteArray, ARRAY_BASE_OFFSET + index);
}

代码示例来源:origin: real-logic/agrona

public double getDouble(final int index)
{
  boundsCheck0(index, SIZE_OF_DOUBLE);
  return UNSAFE.getDouble(null, address + index);
}

代码示例来源:origin: real-logic/agrona

public double getDouble(final long index)
{
  if (SHOULD_BOUNDS_CHECK)
  {
    boundsCheck0(index, SIZE_OF_DOUBLE);
  }
  return UNSAFE.getDouble(null, addressOffset + index);
}

代码示例来源:origin: real-logic/agrona

public double getDouble(final int index)
{
  if (SHOULD_BOUNDS_CHECK)
  {
    boundsCheck0(index, SIZE_OF_DOUBLE);
  }
  return UNSAFE.getDouble(byteArray, addressOffset + index);
}

代码示例来源:origin: apache/avro

@Override
 protected void write(Object object, Encoder out) throws IOException {
  out.writeDouble(UNSAFE.getDouble(object, offset));
 }
}

代码示例来源:origin: RuedigerMoeller/fast-serialization

@Override
public double getDouble(long byteIndex) {
  checkIndex(byteIndex,8);
  return unsafe.getDouble(base, off + byteIndex);
}

相关文章

微信公众号

最新文章

更多

Unsafe类方法