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 ValueLayoutBITS_16_BEA value layout constant with size of two bytes, and byte order set toByteOrder.BIG_ENDIAN.static ValueLayoutBITS_16_LEA value layout constant with size of two bytes, and byte order set toByteOrder.LITTLE_ENDIAN.static ValueLayoutBITS_32_BEA value layout constant with size of four bytes, and byte order set toByteOrder.BIG_ENDIAN.static ValueLayoutBITS_32_LEA value layout constant with size of four bytes, and byte order set toByteOrder.LITTLE_ENDIAN.static ValueLayoutBITS_64_BEA value layout constant with size of eight bytes, and byte order set toByteOrder.BIG_ENDIAN.static ValueLayoutBITS_64_LEA value layout constant with size of eight bytes, and byte order set toByteOrder.LITTLE_ENDIAN.static ValueLayoutBITS_8_BEA value layout constant with size of one byte, and byte order set toByteOrder.BIG_ENDIAN.static ValueLayoutBITS_8_LEA value layout constant with size of one byte, and byte order set toByteOrder.LITTLE_ENDIAN.static ValueLayoutJAVA_BYTEA value layout constant whose size is the same as that of a Javabyte, and byte order set toByteOrder.nativeOrder().static ValueLayoutJAVA_CHARA value layout constant whose size is the same as that of a Javachar, and byte order set toByteOrder.nativeOrder().static ValueLayoutJAVA_DOUBLEA value layout constant whose size is the same as that of a Javadouble, and byte order set toByteOrder.nativeOrder().static ValueLayoutJAVA_FLOATA value layout constant whose size is the same as that of a Javafloat, and byte order set toByteOrder.nativeOrder().static ValueLayoutJAVA_INTA value layout constant whose size is the same as that of a Javaint, and byte order set toByteOrder.nativeOrder().static ValueLayoutJAVA_LONGA value layout constant whose size is the same as that of a Javalong, and byte order set toByteOrder.nativeOrder().static ValueLayoutJAVA_SHORTA value layout constant whose size is the same as that of a Javashort, and byte order set toByteOrder.nativeOrder().static MemoryLayoutPAD_16A padding layout constant with size of two bytes.static MemoryLayoutPAD_32A padding layout constant with size of four bytes.static MemoryLayoutPAD_64A padding layout constant with size of eight bytes.static MemoryLayoutPAD_8A 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().
-