# Uses of Interface
java.lang.foreign.ValueLayout.OfByte

Packages that use ValueLayout.OfBytePREVIEW
Package
Description
java.lang.foreign
Provides low-level access to memory and functions outside the Java runtime.

## Uses of ValueLayout.OfBytePREVIEW in java.lang.foreign

Fields in java.lang.foreign declared as ValueLayout.OfBytePREVIEW
Modifier and Type
Field
Description
`static final ValueLayout.OfBytePREVIEW`
ValueLayout.`JAVA_BYTE`
A value layout constant whose size is the same as that of a Java `byte`, byte alignment set to 1, and byte order set to `ByteOrder.nativeOrder()`.
Methods in java.lang.foreign that return ValueLayout.OfBytePREVIEW
Modifier and Type
Method
Description
`ValueLayout.OfBytePREVIEW`
ValueLayout.OfByte.`withByteAlignment(long byteAlignment)`
Returns a memory layout with the same characteristics as this layout, but with the given alignment constraint (in bytes).
`ValueLayout.OfBytePREVIEW`
ValueLayout.OfByte.`withName(String name)`
Returns a memory layout with the same characteristics as this layout, but with the given name.
`ValueLayout.OfBytePREVIEW`
ValueLayout.OfByte.`withOrder(ByteOrder order)`
Returns a value layout with the same characteristics as this layout, but with the given byte order.
`ValueLayout.OfBytePREVIEW`
ValueLayout.OfByte.`withoutName()`
Returns a memory layout with the same characteristics as this layout, but with no name.
Methods in java.lang.foreign with parameters of type ValueLayout.OfBytePREVIEW
Modifier and Type
Method
Description
`default MemorySegmentPREVIEW`
SegmentAllocator.`allocate(ValueLayout.OfBytePREVIEW layout, byte value)`
Allocates a memory segment with the given layout and initializes it with the given byte value.
`default MemorySegmentPREVIEW`
SegmentAllocator.`allocateArray(ValueLayout.OfBytePREVIEW elementLayout, byte... elements)`
Allocates a memory segment with the given layout and initializes it with the given byte elements.
`default byte`
MemorySegment.`get(ValueLayout.OfBytePREVIEW layout, long offset)`
Reads a byte from this segment at the given offset, with the given layout.
`default byte`
MemorySegment.`getAtIndex(ValueLayout.OfBytePREVIEW layout, long index)`
Reads a byte from this segment at the given index, scaled by the given layout size.
`default void`
MemorySegment.`set(ValueLayout.OfBytePREVIEW layout, long offset, byte value)`
Writes a byte into this segment at the given offset, with the given layout.
`default void`
MemorySegment.`setAtIndex(ValueLayout.OfBytePREVIEW layout, long index, byte value)`
Writes a byte into this segment at the given index, scaled by the given layout size.
`byte[]`
MemorySegment.`toArray(ValueLayout.OfBytePREVIEW elementLayout)`
Copy the contents of this memory segment into a new byte array.