Don't mutate input in OSMemory.setIntArray/setShortArray.
We now take a copy and then swap bytes in the copy if necessary,
rather than swapping the input, copying, and swapping the input
back.
I've switched to GetShortArrayRegion/GetIntArrayRegion instead
of GetPrimitiveArrayCritical because the latter makes life
unnecessarily hard for the VM/GC, and requires a second JNI call
to undo.
I've also renamed the native functions to match the Java methods
they implement.
(Tested by running the nio tests on the emulator, with added
logging to check that all four variants are called.)
Bug:
2019584