-
-
Save animeshtrivedi/f97d9f5c696f102b7fe83b20a3b5644b to your computer and use it in GitHub Desktop.
sun.misc.Unsafe use in Scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getUnsafeInstance: sun.misc.Unsafe = { | |
val f = classOf[sun.misc.Unsafe].getDeclaredField("theUnsafe") | |
f.setAccessible(true) | |
val unsafe = f.get(null).asInstanceOf[sun.misc.Unsafe] | |
unsafe | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment