# Uses of Interface
java.lang.foreign.ValueLayout

Packages that use ValueLayoutPREVIEW
Package
Description
java.lang.foreign
Provides low-level access to memory and functions outside the Java runtime.
java.lang.invoke
The `java.lang.invoke` package provides low-level primitives for interacting with the Java Virtual Machine.

- ## Uses of ValueLayoutPREVIEW in java.lang.foreign

  Subinterfaces of ValueLayoutPREVIEW in java.lang.foreign
  Modifier and Type
  Interface
  Description
  `static interface`
  `ValueLayout.OfAddressPREVIEW`
  Preview.
  A value layout whose carrier is `MemorySegment.class`.
  `static interface`
  `ValueLayout.OfBooleanPREVIEW`
  Preview.
  A value layout whose carrier is `boolean.class`.
  `static interface`
  `ValueLayout.OfBytePREVIEW`
  Preview.
  A value layout whose carrier is `byte.class`.
  `static interface`
  `ValueLayout.OfCharPREVIEW`
  Preview.
  A value layout whose carrier is `char.class`.
  `static interface`
  `ValueLayout.OfDoublePREVIEW`
  Preview.
  A value layout whose carrier is `double.class`.
  `static interface`
  `ValueLayout.OfFloatPREVIEW`
  Preview.
  A value layout whose carrier is `float.class`.
  `static interface`
  `ValueLayout.OfIntPREVIEW`
  Preview.
  A value layout whose carrier is `int.class`.
  `static interface`
  `ValueLayout.OfLongPREVIEW`
  Preview.
  A value layout whose carrier is `long.class`.
  `static interface`
  `ValueLayout.OfShortPREVIEW`
  Preview.
  A value layout whose carrier is `short.class`.
  Methods in java.lang.foreign that return ValueLayoutPREVIEW
  Modifier and Type
  Method
  Description
  `static ValueLayoutPREVIEW`
  MemoryLayout.`valueLayout(Class<?> carrier, ByteOrder order)`
  Creates a value layout of given Java carrier and byte order.
  `ValueLayoutPREVIEW`
  ValueLayout.`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).
  `ValueLayoutPREVIEW`
  ValueLayout.`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.
  `ValueLayoutPREVIEW`
  ValueLayout.`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 ValueLayoutPREVIEW
  Modifier and Type
  Method
  Description
  `static void`
  MemorySegment.`copy(MemorySegmentPREVIEW srcSegment, ValueLayoutPREVIEW srcElementLayout, long srcOffset, MemorySegmentPREVIEW dstSegment, ValueLayoutPREVIEW dstElementLayout, long dstOffset, long elementCount)`
  Performs a bulk copy from source segment to destination segment.
  `static void`
  MemorySegment.`copy(MemorySegmentPREVIEW srcSegment, ValueLayoutPREVIEW srcLayout, long srcOffset, Object dstArray, int dstIndex, int elementCount)`
  Copies a number of elements from a source memory segment to a destination array.
  `static void`
  MemorySegment.`copy(Object srcArray, int srcIndex, MemorySegmentPREVIEW dstSegment, ValueLayoutPREVIEW dstLayout, long dstOffset, int elementCount)`
  Copies a number of elements from a source array to a destination memory segment.

- ## Uses of ValueLayoutPREVIEW in java.lang.invoke

  Methods in java.lang.invoke with parameters of type ValueLayoutPREVIEW
  Modifier and Type
  Method
  Description
  `static VarHandle`
  MethodHandles.`memorySegmentViewVarHandle(ValueLayoutPREVIEW layout)`
  Preview.
  Creates a var handle object, which can be used to dereference a memory segmentPREVIEW by viewing its contents as a sequence of the provided value layout.