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

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

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

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