# Uses of Interface
java.lang.foreign.ValueLayout.OfFloat

Packages that use ValueLayout.OfFloatPREVIEW
Package
Description
java.lang.foreign
Provides low-level access to memory and functions outside the Java runtime.

- ## Uses of ValueLayout.OfFloatPREVIEW in java.lang.foreign

  Fields in java.lang.foreign declared as ValueLayout.OfFloatPREVIEW
  Modifier and Type
  Field
  Description
  `static final ValueLayout.OfFloatPREVIEW`
  ValueLayout.`JAVA_FLOAT`
  A value layout constant whose size is the same as that of a Java `float`, bit alignment set to 32, and byte order set to `ByteOrder.nativeOrder()`.
  `static final ValueLayout.OfFloatPREVIEW`
  ValueLayout.`JAVA_FLOAT_UNALIGNED`
  An unaligned value layout constant whose size is the same as that of a Java `float` and byte order set to `ByteOrder.nativeOrder()`.
  Methods in java.lang.foreign that return ValueLayout.OfFloatPREVIEW
  Modifier and Type
  Method
  Description
  `ValueLayout.OfFloatPREVIEW`
  ValueLayout.OfFloat.`withBitAlignment(long bitAlignment)`
  Returns a memory layout of the same type with the same size and name as this layout, but with the specified alignment constraint (in bits).
  `ValueLayout.OfFloatPREVIEW`
  ValueLayout.OfFloat.`withName(String name)`
  Returns a memory layout of the same type with the same size and alignment constraint as this layout, but with the specified name.
  `ValueLayout.OfFloatPREVIEW`
  ValueLayout.OfFloat.`withOrder(ByteOrder order)`
  Returns a value layout with the same carrier, alignment constraint and name as this value layout, but with the specified byte order.
  Methods in java.lang.foreign with parameters of type ValueLayout.OfFloatPREVIEW
  Modifier and Type
  Method
  Description
  `default MemorySegmentPREVIEW`
  SegmentAllocator.`allocate(ValueLayout.OfFloatPREVIEW layout, float value)`
  Allocates a memory segment with the given layout and initializes it with the given float value.
  `default MemorySegmentPREVIEW`
  SegmentAllocator.`allocateArray(ValueLayout.OfFloatPREVIEW elementLayout, float... elements)`
  Allocates a memory segment with the given layout and initializes it with the given float elements.
  `default float`
  MemorySegment.`get(ValueLayout.OfFloatPREVIEW layout, long offset)`
  Reads a float from this segment at the given offset, with the given layout.
  `default float`
  MemorySegment.`getAtIndex(ValueLayout.OfFloatPREVIEW layout, long index)`
  Reads a float from this segment at the given index, scaled by the given layout size.
  `default void`
  MemorySegment.`set(ValueLayout.OfFloatPREVIEW layout, long offset, float value)`
  Writes a float into this segment at the given offset, with the given layout.
  `default void`
  MemorySegment.`setAtIndex(ValueLayout.OfFloatPREVIEW layout, long index, float value)`
  Writes a float into this segment at the given index, scaled by the given layout size.
  `float[]`
  MemorySegment.`toArray(ValueLayout.OfFloatPREVIEW elementLayout)`
  Copy the contents of this memory segment into a new float array.