All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jvmbytes.spy.util.UnsafeUtils Maven / Gradle / Ivy

package com.jvmbytes.spy.util;

import sun.misc.Unsafe;

import java.lang.reflect.Field;

/**
 * Sum Jvm Unsafe
 *
 * @author luanjia
 */
public class UnsafeUtils {

    public static Unsafe getUnsafe() throws NoSuchFieldException, IllegalAccessException {
        final Field f = Unsafe.class.getDeclaredField("theUnsafe");
        f.setAccessible(true);
        return (Unsafe) f.get(null);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy