Package com.google.common.hash
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final sun.misc.Unsafe
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static sun.misc.Unsafe
Returns an Unsafe.Returns the enum constant of this class with the specified name.values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface com.google.common.hash.LittleEndianByteArray.LittleEndianBytes
getLongLittleEndian, putLongLittleEndian
-
Enum Constant Details
-
UNSAFE_LITTLE_ENDIAN
-
UNSAFE_BIG_ENDIAN
-
-
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
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
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 nameNullPointerException
- 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
-