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

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

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

Unsafe.putDouble介绍

暂无

代码示例

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

@Override
public void putDouble(long byteIndex, double d) {
  unsafe.putDouble( baseAdress + byteIndex, d);
}

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

public static void putDouble( Object obj, long offset, double value )
{
  unsafe.putDouble( obj, offset, value );
}

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

/**
 * Stores double value into object field.
 *
 * @param obj Object.
 * @param fieldOff Field offset.
 * @param val Value.
 */
public static void putDoubleField(Object obj, long fieldOff, double val) {
  UNSAFE.putDouble(obj, fieldOff, val);
}

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

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

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

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

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

@Override
public void putDouble(Object target, long offset, double value) {
 unsafe.putDouble(target, offset, value);
}

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

@Override
public void writeDouble(double v) {
  UNSAFE.putDouble(position, v);
  position += 8;
}

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

/**
 * Sets the specified 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 void setDouble(int index, double value)
{
  checkIndexLength(index, SIZE_OF_DOUBLE);
  unsafe.putDouble(base, address + index, value);
}

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

public final void setDoubleValue(Object newObj, double l) throws IllegalAccessException {
  if (!isAndroid && memOffset >= 0) {
    FSTUtil.unFlaggedUnsafe.putDouble(newObj, memOffset, l);
    return;
  }
  field.setDouble(newObj, l);
}

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

public static void setDouble(byte[] bytes, int index, double value)
{
  checkIndexLength(bytes.length, index, SIZE_OF_DOUBLE);
  unsafe.putDouble(bytes, ((long) ARRAY_BYTE_BASE_OFFSET) + index, value);
}

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

@Override
public void putDouble(long byteIndex, double d) {
  checkIndex(byteIndex,8);
  unsafe.putDouble(base, off + byteIndex, d);
}

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

public static void putDouble( long address, double value )
{
  checkAccess( address, Double.BYTES );
  unsafe.putDouble( address, value );
}

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

/**
 * Stores given double value. Alignment aware.
 *
 * @param addr Address.
 * @param val Value.
 */
public static void putDouble(long addr, double val) {
  if (UNALIGNED)
    UNSAFE.putDouble(addr, val);
  else
    putLongByByte(addr, Double.doubleToLongBits(val), BIG_ENDIAN);
}

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

/**
 * Stores double value into byte array. Alignment aware.
 *
 * @param arr Byte array.
 * @param off Offset.
 * @param val Value.
 */
public static void putDouble(byte[] arr, long off, double val) {
  if (UNALIGNED)
    UNSAFE.putDouble(arr, off, val);
  else
    putLongByByte(arr, off, Double.doubleToLongBits(val), BIG_ENDIAN);
}

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

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

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

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

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

public void putDouble(final int index, final double value)
{
  ensureCapacity(index, SIZE_OF_DOUBLE);
  UNSAFE.putDouble(byteArray, ARRAY_BASE_OFFSET + index, value);
}

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

public void putDouble(final int index, final double value)
{
  ensureCapacity(index, SIZE_OF_DOUBLE);
  UNSAFE.putDouble(null, address + index, value);
}

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

@Override
public void putDouble(long byteIndex, double d) {
  checkIndex(byteIndex,8);
  unsafe.putDouble(base, off + byteIndex, d);
}

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

public final void setDoubleValue(Object newObj, double l) throws IllegalAccessException {
  if (!isAndroid && memOffset >= 0) {
    FSTUtil.unFlaggedUnsafe.putDouble(newObj, memOffset, l);
    return;
  }
  field.setDouble(newObj, l);
}

相关文章

Unsafe类方法