Package jnr.ffi.byref

Class FloatByReference

All Implemented Interfaces:
Serializable, ByReference<Float>

public final class FloatByReference extends AbstractNumberReference<Float>
See Also:
  • Constructor Details

    • FloatByReference

      public FloatByReference()
      Creates a new reference to a short value initialized to zero.
    • FloatByReference

      public FloatByReference(Float value)
      Creates a new reference to a float value
      Parameters:
      value - the initial native value
    • FloatByReference

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

    • toNative

      public void toNative(Runtime runtime, Pointer buffer, long offset)
      Copies the float 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 float 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