-
Notifications
You must be signed in to change notification settings - Fork 139
Expand file tree
/
Copy pathUnsafe.java
More file actions
30 lines (20 loc) · 869 Bytes
/
Unsafe.java
File metadata and controls
30 lines (20 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package sun.misc;
/**
* Stub for JDK internal ckass sun.misc.Unsafe.
* <p>
* - When crossing compiling for Java SE 7 and 8, this stub class can bypass compiler sun-api
* warnings.
* - Only used methods are exported.
* - In test and production runtime, the real class is loaded from boot classpath.
*/
public final class Unsafe {
public native Object getObject(Object o, long offset);
public native int getInt(Object o, long offset);
public native boolean getBoolean(Object o, long offset);
public native byte getByte(Object o, long offset);
public native short getShort(Object o, long offset);
public native char getChar(Object o, long offset);
public native long getLong(Object o, long offset);
public native long objectFieldOffset(java.lang.reflect.Field f);
public native int arrayBaseOffset(Class arrayClass);
}