Package jnr.ffi.byref

Class DoubleByReference

All Implemented Interfaces:
Serializable, ByReference<Double>

public final class DoubleByReference extends AbstractNumberReference<Double>
See Also:
  • Field Details

    • DEFAULT

      private static final Double DEFAULT
  • Constructor Details

    • DoubleByReference

      public DoubleByReference()
      Creates a new reference to a double value initialized to zero.
    • DoubleByReference

      public DoubleByReference(Double value)
      Creates a new reference to a double value
      Parameters:
      value - the initial native value
    • DoubleByReference

      public DoubleByReference(double value)
      Creates a new reference to a double value
      Parameters:
      value - the initial native value
  • Method Details

    • toNative

      public void toNative(Runtime runtime, Pointer buffer, long offset)
      Copies the double value to native memory
      Parameters:
      runtime - the current runtime.
      buffer - the native memory buffer.
      offset - the memory offset.
    • fromNative

      public void fromNative(Runtime runtime, Pointer buffer, long offset)
      Copies the double value from native memory
      Parameters:
      runtime - the current runtime.
      buffer - the native memory buffer.
      offset - the memory offset.
    • nativeSize

      public final int nativeSize(Runtime runtime)
      Gets the native size of type of reference in bytes.
      Parameters:
      runtime - the current runtime.
      Returns:
      the size of a byte in bytes.