Enum Class LittleEndianByteArray.UnsafeByteArray

java.lang.Object
java.lang.Enum<LittleEndianByteArray.UnsafeByteArray>
com.google.common.hash.LittleEndianByteArray.UnsafeByteArray
All Implemented Interfaces:
LittleEndianByteArray.LittleEndianBytes, Serializable, Comparable<LittleEndianByteArray.UnsafeByteArray>, Constable
Enclosing class:
LittleEndianByteArray

private static enum LittleEndianByteArray.UnsafeByteArray extends Enum<LittleEndianByteArray.UnsafeByteArray> implements LittleEndianByteArray.LittleEndianBytes
The only reference to Unsafe is in this nested class. We set things up so that if Unsafe.theUnsafe is inaccessible, the attempt to load the nested class fails, and the outer class's static initializer can fall back on a non-Unsafe version.
  • Enum Constant Details

  • Field Details

    • theUnsafe

      private static final sun.misc.Unsafe theUnsafe
    • BYTE_ARRAY_BASE_OFFSET

      private static final int BYTE_ARRAY_BASE_OFFSET
  • Constructor Details

    • UnsafeByteArray

      private UnsafeByteArray()
  • Method Details

    • values

      public static LittleEndianByteArray.UnsafeByteArray[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static LittleEndianByteArray.UnsafeByteArray valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getUnsafe

      private static sun.misc.Unsafe getUnsafe()
      Returns an Unsafe. Suitable for use in a 3rd party package. Replace with a simple call to Unsafe.getUnsafe when integrating into a JDK.
      Returns:
      an Unsafe instance if successful