/[classpath]/classpath/java/nio/ByteOrder.java
ViewVC logotype

Diff of /classpath/java/nio/ByteOrder.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by mkoch, Thu Nov 7 12:35:58 2002 UTC revision 1.5 by mkoch, Tue Mar 11 08:02:23 2003 UTC
# Line 35  this exception to your version of the li Line 35  this exception to your version of the li
35  obligated to do so.  If you do not wish to do so, delete this  obligated to do so.  If you do not wish to do so, delete this
36  exception statement from your version. */  exception statement from your version. */
37    
 package java.nio;  
38    
39    package java.nio;
40    
41    /**
42     * @author Michael Koch
43     * @since 1.4
44     */
45  public final class ByteOrder  public final class ByteOrder
46  {  {
47    public static final ByteOrder BIG_ENDIAN     = new ByteOrder();    public static final ByteOrder BIG_ENDIAN     = new ByteOrder();
48    public static final ByteOrder LITTLE_ENDIAN  = new ByteOrder();    public static final ByteOrder LITTLE_ENDIAN  = new ByteOrder();
49    
50    public static ByteOrder nativeOrder()    /**
51       * Returns the native byte order of the platform currently running.
52       */
53      public static ByteOrder nativeOrder ()
54    {    {
55      return BIG_ENDIAN;      return (System.getProperty ("gnu.cpu.endian") == "big"
56                ? BIG_ENDIAN : LITTLE_ENDIAN);
57    }    }
58    
59      /**
60       * Returns a string representation of the byte order.
61       */
62    public String toString()    public String toString()
63    {    {
64      return this == BIG_ENDIAN ? "BIG_ENDIAN" : "LITTLE_ENDIAN";      return this == BIG_ENDIAN ? "BIG_ENDIAN" : "LITTLE_ENDIAN";

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26