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

rpc.turbo.util.UnsafeUtils Maven / Gradle / Ivy

There is a newer version: 0.0.9
Show newest version
package rpc.turbo.util;

import sun.misc.Unsafe;

public class UnsafeUtils {
	final static private Unsafe _unsafe;

	static {
		Unsafe tmpUnsafe = null;

		try {
			java.lang.reflect.Field field = sun.misc.Unsafe.class.getDeclaredField("theUnsafe");
			field.setAccessible(true);
			tmpUnsafe = (sun.misc.Unsafe) field.get(null);
		} catch (java.lang.Exception e) {
			throw new Error(e);
		}

		_unsafe = tmpUnsafe;
	}

	public static final Unsafe unsafe() {
		return _unsafe;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy