Uses of Interface
java.lang.foreign.ValueLayout.OfInt
Package
Description
Provides low-level access to memory and functions outside the Java runtime.
-
Uses of ValueLayout.OfIntPREVIEW in java.lang.foreign
Modifier and TypeFieldDescriptionstatic final ValueLayout.OfIntPREVIEW
ValueLayout.JAVA_INT
A value layout constant whose size is the same as that of a Javaint
, byte alignment set to 4, and byte order set toByteOrder.nativeOrder()
.static final ValueLayout.OfIntPREVIEW
ValueLayout.JAVA_INT_UNALIGNED
An unaligned value layout constant whose size is the same as that of a Javaint
and byte order set toByteOrder.nativeOrder()
.Modifier and TypeMethodDescriptionValueLayout.OfInt.withByteAlignment
(long byteAlignment) Returns a memory layout with the same characteristics as this layout, but with the given alignment constraint (in bytes).Returns a memory layout with the same characteristics as this layout, but with the given name.Returns a value layout with the same characteristics as this layout, but with the given byte order.ValueLayout.OfInt.withoutName()
Returns a memory layout with the same characteristics as this layout, but with no name.Modifier and TypeMethodDescriptiondefault MemorySegmentPREVIEW
SegmentAllocator.allocate
(ValueLayout.OfIntPREVIEW layout, int value) Allocates a memory segment with the given layout and initializes it with the given int value.default MemorySegmentPREVIEW
SegmentAllocator.allocateArray
(ValueLayout.OfIntPREVIEW elementLayout, int... elements) Allocates a memory segment with the given layout and initializes it with the given int elements.default int
MemorySegment.get
(ValueLayout.OfIntPREVIEW layout, long offset) Reads an int from this segment at the given offset, with the given layout.default int
MemorySegment.getAtIndex
(ValueLayout.OfIntPREVIEW layout, long index) Reads an int from this segment at the given index, scaled by the given layout size.default void
MemorySegment.set
(ValueLayout.OfIntPREVIEW layout, long offset, int value) Writes an int into this segment at the given offset, with the given layout.default void
MemorySegment.setAtIndex
(ValueLayout.OfIntPREVIEW layout, long index, int value) Writes an int into this segment at the given index, scaled by the given layout size.int[]
MemorySegment.toArray
(ValueLayout.OfIntPREVIEW elementLayout) Copy the contents of this memory segment into a new int array.