
org.mk300.marshal.common.TheUnsafe Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minimum-marshaller Show documentation
Show all versions of minimum-marshaller Show documentation
The high performance and density marshaller
package org.mk300.marshal.common;
import java.lang.reflect.Field;
import sun.misc.Unsafe;
@SuppressWarnings({"restriction"})
public class TheUnsafe {
public final static Unsafe unsafe;
public final static long byteArrayBaseOffset;
static {
try {
Field field = Unsafe.class.getDeclaredField("theUnsafe");
field.setAccessible(true);
unsafe = (Unsafe) field.get(null);
byteArrayBaseOffset = unsafe.arrayBaseOffset(byte[].class);
} catch (Exception e) {
throw new Error("NG unsafe", e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy