Uses of Interface java.lang.foreign.ValueLayout (Java SE 26 & JDK 26)
Description: use: module: java.base, package: java.lang.foreign, interface: ValueLayout

# Uses of Interface
java.lang.foreign.ValueLayout

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

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

  Subinterfaces of ValueLayout in java.lang.foreign
  Modifier and Type
  Interface
  Description
  `interface`
  `AddressLayout`
  A value layout used to model the address of some region of memory.
  `static interface`
  `ValueLayout.OfBoolean`
  A value layout whose carrier is `boolean.class`.
  `static interface`
  `ValueLayout.OfByte`
  A value layout whose carrier is `byte.class`.
  `static interface`
  `ValueLayout.OfChar`
  A value layout whose carrier is `char.class`.
  `static interface`
  `ValueLayout.OfDouble`
  A value layout whose carrier is `double.class`.
  `static interface`
  `ValueLayout.OfFloat`
  A value layout whose carrier is `float.class`.
  `static interface`
  `ValueLayout.OfInt`
  A value layout whose carrier is `int.class`.
  `static interface`
  `ValueLayout.OfLong`
  A value layout whose carrier is `long.class`.
  `static interface`
  `ValueLayout.OfShort`
  A value layout whose carrier is `short.class`.
  Methods in java.lang.foreign that return ValueLayout
  Modifier and Type
  Method
  Description
  `ValueLayout`
  ValueLayout.`withByteAlignment(long byteAlignment)`
  Returns a memory layout with the same characteristics as this layout, but with the given alignment constraint (in bytes).
  `ValueLayout`
  ValueLayout.`withName(String name)`
  Returns a memory layout with the same characteristics as this layout, but with the given name.
  `ValueLayout`
  ValueLayout.`withOrder(ByteOrder order)`
  Returns a value layout with the same characteristics as this layout, but with the given byte order.
  `ValueLayout`
  ValueLayout.`withoutName()`
  Returns a memory layout with the same characteristics as this layout, but with no name.
  Methods in java.lang.foreign with parameters of type ValueLayout
  Modifier and Type
  Method
  Description
  `default MemorySegment`
  SegmentAllocator.`allocateFrom(ValueLayout elementLayout, MemorySegment source, ValueLayout sourceElementLayout, long sourceOffset, long elementCount)`
  Returns a new memory segment initialized with the contents of the provided segment.
  `static void`
  MemorySegment.`copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long srcOffset, MemorySegment dstSegment, ValueLayout dstElementLayout, long dstOffset, long elementCount)`
  Performs a bulk copy from source segment to destination segment.
  `static void`
  MemorySegment.`copy(MemorySegment srcSegment, ValueLayout 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, MemorySegment dstSegment, ValueLayout dstLayout, long dstOffset, int elementCount)`
  Copies a number of elements from a source array to a destination memory segment.