Module java.base

Interface ValueLayout

All Superinterfaces:
MemoryLayout
All Known Subinterfaces:
AddressLayout, ValueLayout.OfBoolean, ValueLayout.OfByte, ValueLayout.OfChar, ValueLayout.OfDouble, ValueLayout.OfFloat, ValueLayout.OfInt, ValueLayout.OfLong, ValueLayout.OfShort

A layout that models values of basic data types. Examples of values modeled by a value layout are integral values (either signed or unsigned), floating-point values and address values.

Each value layout has a size, an alignment (both expressed in bytes), a byte order, and a carrier, that is, the Java type that should be used when accessing a region of memory using the value layout.

This class defines useful value layout constants for Java primitive types and addresses.

API Note:
Some characteristics of the Java layout constants are platform-dependent. For instance, the byte order of these constants is set to the native byte order, thus making it easy to work with other APIs, such as arrays and ByteBuffer. Moreover, the alignment constraint of JAVA_LONG and JAVA_DOUBLE is set to 8 bytes on 64-bit platforms, but only to 4 bytes on 32-bit platforms.
Implementation Requirements:
implementing classes and subclasses are immutable, thread-safe and value-based.
Sealed Class Hierarchy Graph:
Sealed class hierarchy graph for ValueLayoutSealed class hierarchy graph for ValueLayout
Since:
22