摘要:
如何使用Unsafe类呢?方式一:通过Unsafe提供的工厂方法。Unsafe unsafe = Unsafe.getUnsafe(); 通过这样的方式获得Unsafe的实力会抛出异常信息,因为在unsafe的源码中会有对安全性的检查public static Unsafe getUnsafe() { Class cc = sun.reflect.Reflection.getCallerClass(2); if (cc.getClassLoader() != null) throw new SecurityException("Unsafe")... 阅读全文
posted @ 2012-02-20 11:27
focusJ
阅读(5401)
评论(1)
推荐(1)