summaryrefslogtreecommitdiff
path: root/java/nio/ByteOrder.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/nio/ByteOrder.java')
-rw-r--r--java/nio/ByteOrder.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/java/nio/ByteOrder.java b/java/nio/ByteOrder.java
index 77cd64db0..0e3b9173e 100644
--- a/java/nio/ByteOrder.java
+++ b/java/nio/ByteOrder.java
@@ -61,7 +61,9 @@ public final class ByteOrder
*/
public static ByteOrder nativeOrder()
{
- return ("big".equals(System.getProperty("gnu.cpu.endian"))
+ // Let this fail with an NPE when the property is not set correctly.
+ // Otherwise we risk that NIO is silently working wrong.
+ return (System.getProperty("gnu.cpu.endian").equals("big")
? BIG_ENDIAN : LITTLE_ENDIAN);
}