Package org.h2.util
Class Bits
java.lang.Object
org.h2.util.Bits
Manipulations with bytes and arrays. Specialized implementation for Java 9
and later versions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VarHandleVarHandle giving access to elements of a byte[] array viewed as if it were a double[] array on big-endian system.static final VarHandleVarHandle giving access to elements of a byte[] array viewed as if it were a double[] array on little-endian system.static final VarHandleVarHandle giving access to elements of a byte[] array viewed as if it were an int[] array on big-endian system.static final VarHandleVarHandle giving access to elements of a byte[] array viewed as if it were an int[] array on little-endian system.static final VarHandleVarHandle giving access to elements of a byte[] array viewed as if it were a long[] array on big-endian system.static final VarHandleVarHandle giving access to elements of a byte[] array viewed as if it were a long[] array on little-endian system. -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]uuidToBytes(long msb, long lsb) Converts UUID value to byte array in big-endian order.static byte[]uuidToBytes(UUID uuid) Converts UUID value to byte array in big-endian order.
-
Field Details
-
INT_VH_BE
VarHandle giving access to elements of a byte[] array viewed as if it were an int[] array on big-endian system. -
INT_VH_LE
VarHandle giving access to elements of a byte[] array viewed as if it were an int[] array on little-endian system. -
LONG_VH_BE
VarHandle giving access to elements of a byte[] array viewed as if it were a long[] array on big-endian system. -
LONG_VH_LE
VarHandle giving access to elements of a byte[] array viewed as if it were a long[] array on little-endian system. -
DOUBLE_VH_BE
VarHandle giving access to elements of a byte[] array viewed as if it were a double[] array on big-endian system. -
DOUBLE_VH_LE
VarHandle giving access to elements of a byte[] array viewed as if it were a double[] array on little-endian system.
-
-
Method Details
-
uuidToBytes
public static byte[] uuidToBytes(long msb, long lsb) Converts UUID value to byte array in big-endian order.- Parameters:
msb- most significant part of UUIDlsb- least significant part of UUID- Returns:
- byte array representation
-
uuidToBytes
Converts UUID value to byte array in big-endian order.- Parameters:
uuid- UUID value- Returns:
- byte array representation
-