Uses of Interface java.lang.foreign.ValueLayout.OfByte (Java SE 26 & JDK 26)
Description: use: module: java.base, package: java.lang.foreign, interface: ValueLayout, interface: OfByte

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

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

- ## Uses of ValueLayout.OfByte in java.lang.foreign

  Fields in java.lang.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`, byte alignment set to 1, and byte order set to `ByteOrder.nativeOrder()`.
  Methods in java.lang.foreign that return ValueLayout.OfByte
  Modifier and Type
  Method
  Description
  `ValueLayout.OfByte`
  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.OfByte`
  ValueLayout.OfByte.`withName(String name)`
  Returns a memory layout with the same characteristics as this layout, but with the given name.
  `ValueLayout.OfByte`
  ValueLayout.OfByte.`withOrder(ByteOrder order)`
  Returns a value layout with the same characteristics as this layout, but with the given byte order.
  `ValueLayout.OfByte`
  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.OfByte
  Modifier and Type
  Method
  Description
  `default MemorySegment`
  SegmentAllocator.`allocateFrom(ValueLayout.OfByte layout, byte value)`
  Returns a new memory segment initialized with the provided byte value.
  `default MemorySegment`
  SegmentAllocator.`allocateFrom(ValueLayout.OfByte elementLayout, byte... elements)`
  Returns a new memory segment initialized with the elements in the provided byte array.
  `byte`
  MemorySegment.`get(ValueLayout.OfByte layout, long offset)`
  Reads a byte from this segment at the given offset, with the given layout.
  `byte`
  MemorySegment.`getAtIndex(ValueLayout.OfByte layout, long index)`
  Reads a byte from this segment at the given index, scaled by the given layout size.
  `void`
  MemorySegment.`set(ValueLayout.OfByte layout, long offset, byte value)`
  Writes a byte into this segment at the given offset, with the given layout.
  `void`
  MemorySegment.`setAtIndex(ValueLayout.OfByte 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.OfByte elementLayout)`
  Copy the contents of this memory segment into a new byte array.