Class UnsafeAccess
- java.lang.Object
-
- com.github.benmanes.caffeine.base.UnsafeAccess
-
public final class UnsafeAccess extends java.lang.Object
Static access toUnsafe
and convenient utility methods for performing low-level, unsafe operations.Warning: This class is scheduled for removal in version 3.0.0.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
UnsafeAccess()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static sun.misc.Unsafe
load(java.lang.String openJdk, java.lang.String android)
static long
objectFieldOffset(java.lang.Class<?> clazz, java.lang.String fieldName)
Returns the location of a given static field.
-
-
-
Field Detail
-
ANDROID
static final java.lang.String ANDROID
- See Also:
- Constant Field Values
-
OPEN_JDK
static final java.lang.String OPEN_JDK
- See Also:
- Constant Field Values
-
UNSAFE
public static final sun.misc.Unsafe UNSAFE
The Unsafe instance.
-
-
Method Detail
-
objectFieldOffset
public static long objectFieldOffset(java.lang.Class<?> clazz, java.lang.String fieldName)
Returns the location of a given static field.- Parameters:
clazz
- the class containing the fieldfieldName
- the name of the field- Returns:
- the address offset of the field
-
load
static sun.misc.Unsafe load(java.lang.String openJdk, java.lang.String android) throws java.lang.NoSuchMethodException, java.lang.SecurityException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException
- Throws:
java.lang.NoSuchMethodException
java.lang.SecurityException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetException
-
-