This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: java.nio.ByteOrder


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I commited a new implementation (now working) for java.nio.ByteOrder.


Michael
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD4DBQE+bLA8WSOgCCdjSDsRAh+qAJ4nwlfXlbelKTTY6hIMuo25NTZPJgCYhB8q
oxOxoj1ytOsyYc472of9FQ==
=gu4r
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.1770
diff -u -r1.1770 ChangeLog
--- ChangeLog	10 Mar 2003 14:48:08 -0000	1.1770
+++ ChangeLog	10 Mar 2003 15:30:48 -0000
@@ -1,5 +1,11 @@
 2003-03-10  Michael Koch  <konqueror at gmx dot de>
 
+	* java/nio/ByteOrder.java
+	(nativeOrder): Working implementation, added documentation.
+	(toString): Added documentation.
+
+2003-03-10  Michael Koch  <konqueror at gmx dot de>
+
 	* java/net/DatagramSocket.java,
 	java/net/MulticastSocket.java,
 	java/net/Socket.java,
Index: java/nio/ByteOrder.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/nio/ByteOrder.java,v
retrieving revision 1.1
diff -u -r1.1 ByteOrder.java
--- java/nio/ByteOrder.java	1 Nov 2002 12:03:38 -0000	1.1
+++ java/nio/ByteOrder.java	10 Mar 2003 15:30:48 -0000
@@ -35,19 +35,30 @@
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
-package java.nio;
 
+package java.nio;
 
+/**
+ * @author Michael Koch
+ * @since 1.4
+ */
 public final class ByteOrder
 {
   public static final ByteOrder BIG_ENDIAN     = new ByteOrder();
   public static final ByteOrder LITTLE_ENDIAN  = new ByteOrder();
 
-  public static ByteOrder nativeOrder()
+  /**
+   * Returns the native byte order of the platform currently running.
+   */
+  public static ByteOrder nativeOrder ()
   {
-    return BIG_ENDIAN;
+    return (System.getProperty ("gnu.cpu.endian") == "big"
+            ? BIG_ENDIAN : LITTLE_ENDIAN);
   }
 
+  /**
+   * Returns a string representation of the byte order.
+   */
   public String toString()
   {
     return this == BIG_ENDIAN ? "BIG_ENDIAN" : "LITTLE_ENDIAN";

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]