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

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

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

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