Skip to content

Instantly share code, notes, and snippets.

@jkubrynski
Last active August 29, 2015 14:14
Show Gist options
  • Save jkubrynski/4da3d50f30704b37ded0 to your computer and use it in GitHub Desktop.
Save jkubrynski/4da3d50f30704b37ded0 to your computer and use it in GitHub Desktop.
Field field = Unsafe.class.getDeclaredField("theUnsafe");
field.setAccessible(true);
Unsafe unsafe = (Unsafe) field.get(null);
Integer test = 999;
int strAddress = unsafe.getInt("", 8L);
unsafe.putInt(test, 8L, strAddress);
System.out.println(test.getClass());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment