Class UnsafeAccess
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.UnsafeAccess
-
final class UnsafeAccess extends java.lang.ObjectStatic access toUnsafeand convenient utility methods for performing low-level, unsafe operations.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateUnsafeAccess()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static sun.misc.Unsafeload(java.lang.String openJdk, java.lang.String android)static longobjectFieldOffset(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.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException- Throws:
java.lang.NoSuchMethodExceptionjava.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetException
-
-