Package org.h2.util

Class Bits


  • public final class Bits
    extends java.lang.Object
    Manipulations with bytes and arrays. Specialized implementation for Java 9 and later versions.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.invoke.VarHandle DOUBLE_VH_BE
      VarHandle giving access to elements of a byte[] array viewed as if it were a double[] array on big-endian system.
      static java.lang.invoke.VarHandle DOUBLE_VH_LE
      VarHandle giving access to elements of a byte[] array viewed as if it were a double[] array on little-endian system.
      static java.lang.invoke.VarHandle INT_VH_BE
      VarHandle giving access to elements of a byte[] array viewed as if it were an int[] array on big-endian system.
      static java.lang.invoke.VarHandle INT_VH_LE
      VarHandle giving access to elements of a byte[] array viewed as if it were an int[] array on little-endian system.
      static java.lang.invoke.VarHandle LONG_VH_BE
      VarHandle giving access to elements of a byte[] array viewed as if it were a long[] array on big-endian system.
      static java.lang.invoke.VarHandle LONG_VH_LE
      VarHandle giving access to elements of a byte[] array viewed as if it were a long[] array on little-endian system.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] uuidToBytes​(long msb, long lsb)
      Converts UUID value to byte array in big-endian order.
      static byte[] uuidToBytes​(java.util.UUID uuid)
      Converts UUID value to byte array in big-endian order.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • INT_VH_BE

        public static final java.lang.invoke.VarHandle 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

        public static final java.lang.invoke.VarHandle 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

        public static final java.lang.invoke.VarHandle 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

        public static final java.lang.invoke.VarHandle 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

        public static final java.lang.invoke.VarHandle 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

        public static final java.lang.invoke.VarHandle 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 Detail

      • 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 UUID
        lsb - least significant part of UUID
        Returns:
        byte array representation
      • uuidToBytes

        public static byte[] uuidToBytes​(java.util.UUID uuid)
        Converts UUID value to byte array in big-endian order.
        Parameters:
        uuid - UUID value
        Returns:
        byte array representation