reduce need for using direct JNI calls by using Unsafe as appropriate.