How and Why is Unsafe used in Java? | Java Code Geeks
December 17, 2014 7:02 am Overview Doing things which the Java language doesn't allow but are still useful. Java doesn't allow many of the tricks which are available to lower level languages. For most developers this is very good thing, and it not only saves you from yourself, it also saves you from your co-workers. It also makes it easier to import open source code because you know there is limits to how much damage they can do. Or at least there is limits to how much you can do accidentally. If you try hard enough you can still do damage. But why would you even try, you might wonder? When building libraries many (but not all) of the methods in Unsafe are useful and in some cases, there is no other way to do the same thing without using JNI, which is even more dangerous and you lose the "compile once, run anywhere" Deserialization of objects When deserializing or building an object using a framework,Read full article from How and Why is Unsafe used in Java? | Java Code Geeks
No comments:
Post a Comment