src/java.base/share/classes/sun/security/provider/ByteArrayAccess.java
Print this page
@@ -86,17 +86,12 @@
scaleOK && (byteOrder == ByteOrder.BIG_ENDIAN);
}
// Return whether this platform supports full speed int/long memory access
// at unaligned addresses.
- // This code was copied from java.nio.Bits because there is no equivalent
- // public API.
private static boolean unaligned() {
- String arch = java.security.AccessController.doPrivileged
- (new sun.security.action.GetPropertyAction("os.arch", ""));
- return arch.equals("i386") || arch.equals("x86") || arch.equals("amd64")
- || arch.equals("x86_64");
+ return unsafe.unalignedAccess();
}
/**
* byte[] to int[] conversion, little endian byte order.
*/