java.lang.Object
jdk.incubator.foreign.MemoryLayouts
public final class MemoryLayouts extends Object
This class defines useful layout constants. Some of the constants defined in this class are explicit in both
size and byte order (see
BITS_64_BE
), and can therefore be used to explicitly and unambiguously specify the
contents of a memory segment. Other constants make implicit byte order assumptions (see
JAVA_INT
); as such, these constants make it easy to work with other serialization-centric APIs,
such as ByteBuffer
.-
Field Summary
Fields Modifier and Type Field Description static ValueLayout
BITS_16_BE
A value layout constant with size of two bytes, and byte order set toByteOrder.BIG_ENDIAN
.static ValueLayout
BITS_16_LE
A value layout constant with size of two bytes, and byte order set toByteOrder.LITTLE_ENDIAN
.static ValueLayout
BITS_32_BE
A value layout constant with size of four bytes, and byte order set toByteOrder.BIG_ENDIAN
.static ValueLayout
BITS_32_LE
A value layout constant with size of four bytes, and byte order set toByteOrder.LITTLE_ENDIAN
.static ValueLayout
BITS_64_BE
A value layout constant with size of eight bytes, and byte order set toByteOrder.BIG_ENDIAN
.static ValueLayout
BITS_64_LE
A value layout constant with size of eight bytes, and byte order set toByteOrder.LITTLE_ENDIAN
.static ValueLayout
BITS_8_BE
A value layout constant with size of one byte, and byte order set toByteOrder.BIG_ENDIAN
.static ValueLayout
BITS_8_LE
A value layout constant with size of one byte, and byte order set toByteOrder.LITTLE_ENDIAN
.static ValueLayout
JAVA_BYTE
A value layout constant whose size is the same as that of a Javabyte
, and byte order set toByteOrder.nativeOrder()
.static ValueLayout
JAVA_CHAR
A value layout constant whose size is the same as that of a Javachar
, and byte order set toByteOrder.nativeOrder()
.static ValueLayout
JAVA_DOUBLE
A value layout constant whose size is the same as that of a Javadouble
, and byte order set toByteOrder.nativeOrder()
.static ValueLayout
JAVA_FLOAT
A value layout constant whose size is the same as that of a Javafloat
, and byte order set toByteOrder.nativeOrder()
.static ValueLayout
JAVA_INT
A value layout constant whose size is the same as that of a Javaint
, and byte order set toByteOrder.nativeOrder()
.static ValueLayout
JAVA_LONG
A value layout constant whose size is the same as that of a Javalong
, and byte order set toByteOrder.nativeOrder()
.static ValueLayout
JAVA_SHORT
A value layout constant whose size is the same as that of a Javashort
, and byte order set toByteOrder.nativeOrder()
.static MemoryLayout
PAD_16
A padding layout constant with size of two bytes.static MemoryLayout
PAD_32
A padding layout constant with size of four bytes.static MemoryLayout
PAD_64
A padding layout constant with size of eight bytes.static MemoryLayout
PAD_8
A padding layout constant with size of one byte. -
Method Summary
-
Field Details
-
BITS_8_LE
A value layout constant with size of one byte, and byte order set toByteOrder.LITTLE_ENDIAN
. -
BITS_16_LE
A value layout constant with size of two bytes, and byte order set toByteOrder.LITTLE_ENDIAN
. -
BITS_32_LE
A value layout constant with size of four bytes, and byte order set toByteOrder.LITTLE_ENDIAN
. -
BITS_64_LE
A value layout constant with size of eight bytes, and byte order set toByteOrder.LITTLE_ENDIAN
. -
BITS_8_BE
A value layout constant with size of one byte, and byte order set toByteOrder.BIG_ENDIAN
. -
BITS_16_BE
A value layout constant with size of two bytes, and byte order set toByteOrder.BIG_ENDIAN
. -
BITS_32_BE
A value layout constant with size of four bytes, and byte order set toByteOrder.BIG_ENDIAN
. -
BITS_64_BE
A value layout constant with size of eight bytes, and byte order set toByteOrder.BIG_ENDIAN
. -
PAD_8
A padding layout constant with size of one byte. -
PAD_16
A padding layout constant with size of two bytes. -
PAD_32
A padding layout constant with size of four bytes. -
PAD_64
A padding layout constant with size of eight bytes. -
JAVA_BYTE
A value layout constant whose size is the same as that of a Javabyte
, and byte order set toByteOrder.nativeOrder()
. -
JAVA_CHAR
A value layout constant whose size is the same as that of a Javachar
, and byte order set toByteOrder.nativeOrder()
. -
JAVA_SHORT
A value layout constant whose size is the same as that of a Javashort
, and byte order set toByteOrder.nativeOrder()
. -
JAVA_INT
A value layout constant whose size is the same as that of a Javaint
, and byte order set toByteOrder.nativeOrder()
. -
JAVA_LONG
A value layout constant whose size is the same as that of a Javalong
, and byte order set toByteOrder.nativeOrder()
. -
JAVA_FLOAT
A value layout constant whose size is the same as that of a Javafloat
, and byte order set toByteOrder.nativeOrder()
. -
JAVA_DOUBLE
A value layout constant whose size is the same as that of a Javadouble
, and byte order set toByteOrder.nativeOrder()
.
-