Uses of Interface
java.lang.foreign.ValueLayout.OfChar
Package
Description
Provides low-level access to memory and functions outside the Java runtime.
-
Uses of ValueLayout.OfCharPREVIEW in java.lang.foreign
Modifier and TypeFieldDescriptionstatic final ValueLayout.OfCharPREVIEW
ValueLayout.JAVA_CHAR
A value layout constant whose size is the same as that of a Javachar
, byte alignment set to 2, and byte order set toByteOrder.nativeOrder()
.static final ValueLayout.OfCharPREVIEW
ValueLayout.JAVA_CHAR_UNALIGNED
An unaligned value layout constant whose size is the same as that of a Javachar
and byte order set toByteOrder.nativeOrder()
.Modifier and TypeMethodDescriptionValueLayout.OfChar.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.OfChar.withoutName()
Returns a memory layout with the same characteristics as this layout, but with no name.Modifier and TypeMethodDescriptiondefault MemorySegmentPREVIEW
SegmentAllocator.allocate
(ValueLayout.OfCharPREVIEW layout, char value) Allocates a memory segment with the given layout and initializes it with the given char value.default MemorySegmentPREVIEW
SegmentAllocator.allocateArray
(ValueLayout.OfCharPREVIEW elementLayout, char... elements) Allocates a memory segment with the given layout and initializes it with the given char elements.default char
MemorySegment.get
(ValueLayout.OfCharPREVIEW layout, long offset) Reads a char from this segment at the given offset, with the given layout.default char
MemorySegment.getAtIndex
(ValueLayout.OfCharPREVIEW layout, long index) Reads a char from this segment at the given index, scaled by the given layout size.default void
MemorySegment.set
(ValueLayout.OfCharPREVIEW layout, long offset, char value) Writes a char into this segment at the given offset, with the given layout.default void
MemorySegment.setAtIndex
(ValueLayout.OfCharPREVIEW layout, long index, char value) Writes a char into this segment at the given index, scaled by the given layout size.char[]
MemorySegment.toArray
(ValueLayout.OfCharPREVIEW elementLayout) Copy the contents of this memory segment into a new char array.