46 |
*/ |
*/ |
47 |
public final class ByteOrder |
public final class ByteOrder |
48 |
{ |
{ |
49 |
public static final ByteOrder BIG_ENDIAN = new ByteOrder(); |
public static final ByteOrder BIG_ENDIAN = new ByteOrder(); |
50 |
public static final ByteOrder LITTLE_ENDIAN = new ByteOrder(); |
public static final ByteOrder LITTLE_ENDIAN = new ByteOrder(); |
51 |
|
|
|
static |
|
|
{ |
|
|
// load the shared library needed for native methods. |
|
|
if (Configuration.INIT_LOAD_LIBRARY) |
|
|
{ |
|
|
System.loadLibrary ("javanio"); |
|
|
} |
|
|
} |
|
|
|
|
52 |
/** |
/** |
53 |
* Returns the native byte order of the platform currently running. |
* Returns the native byte order of the platform currently running. |
54 |
*/ |
*/ |
55 |
public static ByteOrder nativeOrder () |
public static ByteOrder nativeOrder() |
56 |
{ |
{ |
57 |
return (System.getProperty ("gnu.cpu.endian").equals("big") |
return (System.getProperty ("gnu.cpu.endian").equals("big") |
58 |
? BIG_ENDIAN : LITTLE_ENDIAN); |
? BIG_ENDIAN : LITTLE_ENDIAN); |
67 |
} |
} |
68 |
|
|
69 |
// This class can only be instantiated here. |
// This class can only be instantiated here. |
70 |
private ByteOrder () |
private ByteOrder() |
71 |
{ |
{ |
72 |
} |
} |
73 |
} |
} |