# Uses of Class
jdk.incubator.foreign.ValueLayout.OfChar

Packages that use ValueLayout.OfChar
Package
Description
jdk.incubator.foreign
Classes to support low-level and efficient foreign memory/function access, directly from Java.

## Uses of ValueLayout.OfChar in jdk.incubator.foreign

Fields in jdk.incubator.foreign declared as ValueLayout.OfChar
Modifier and Type
Field
Description
`static final ValueLayout.OfChar`
ValueLayout.`JAVA_CHAR`
A value layout constant whose size is the same as that of a Java `char`, bit alignment set to 8, and byte order set to `ByteOrder.nativeOrder()`.
Methods in jdk.incubator.foreign that return ValueLayout.OfChar
Modifier and Type
Method
Description
`ValueLayout.OfChar`
ValueLayout.OfChar.`withBitAlignment(long alignmentBits)`
`ValueLayout.OfChar`
ValueLayout.OfChar.`withName(String name)`
`ValueLayout.OfChar`
ValueLayout.OfChar.`withOrder(ByteOrder order)`
Methods in jdk.incubator.foreign with parameters of type ValueLayout.OfChar
Modifier and Type
Method
Description
`default MemorySegment`
SegmentAllocator.`allocate(ValueLayout.OfChar layout, char value)`
Allocate a memory segment with given layout and initialize it with given char value.
`default MemorySegment`
SegmentAllocator.`allocateArray(ValueLayout.OfChar elementLayout, char[] array)`
Allocate a memory segment with given layout and initialize it with given char array.
`char`
MemoryAddress.`get(ValueLayout.OfChar layout, long offset)`
Reads a char from this address and offset with given layout.
`default char`
MemorySegment.`get(ValueLayout.OfChar layout, long offset)`
Reads a char from this segment and offset with given layout.
`char`
MemoryAddress.`getAtIndex(ValueLayout.OfChar layout, long index)`
Reads a char from this address and index, scaled by given layout size.
`default char`
MemorySegment.`getAtIndex(ValueLayout.OfChar layout, long index)`
Reads a char from this segment and index, scaled by given layout size.
`void`
MemoryAddress.`set(ValueLayout.OfChar layout, long offset, char value)`
Writes a char to this address instance and offset with given layout.
`default void`
MemorySegment.`set(ValueLayout.OfChar layout, long offset, char value)`
Writes a char to this segment and offset with given layout.
`void`
MemoryAddress.`setAtIndex(ValueLayout.OfChar layout, long index, char value)`
Writes a char to this address instance and index, scaled by given layout size.
`default void`
MemorySegment.`setAtIndex(ValueLayout.OfChar layout, long index, char value)`
Writes a char to this segment and index, scaled by given layout size.
`char[]`
MemorySegment.`toArray(ValueLayout.OfChar elementLayout)`
Copy the contents of this memory segment into a fresh char array.