2003-03-10 Michael Koch <konqueror@gmx.de>
* java/nio/ByteOrder.java (nativeOrder): Working implementation, added documentation. (toString): Added documentation. From-SVN: r64085
This commit is contained in:
parent
7507403ae5
commit
2e65e47e26
2 changed files with 20 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2003-03-10 Michael Koch <konqueror@gmx.de>
|
||||||
|
|
||||||
|
* java/nio/ByteOrder.java
|
||||||
|
(nativeOrder): Working implementation, added documentation.
|
||||||
|
(toString): Added documentation.
|
||||||
|
|
||||||
2003-03-10 Michael Koch <konqueror@gmx.de>
|
2003-03-10 Michael Koch <konqueror@gmx.de>
|
||||||
|
|
||||||
* java/net/DatagramSocket.java,
|
* java/net/DatagramSocket.java,
|
||||||
|
|
|
@ -35,19 +35,30 @@ this exception to your version of the library, but you are not
|
||||||
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
|
||||||
exception statement from your version. */
|
exception statement from your version. */
|
||||||
|
|
||||||
|
|
||||||
package java.nio;
|
package java.nio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Michael Koch
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
public final class ByteOrder
|
public final class ByteOrder
|
||||||
{
|
{
|
||||||
public static final ByteOrder BIG_ENDIAN = new ByteOrder();
|
public static final ByteOrder BIG_ENDIAN = new ByteOrder();
|
||||||
public static final ByteOrder LITTLE_ENDIAN = new ByteOrder();
|
public static final ByteOrder LITTLE_ENDIAN = new ByteOrder();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the native byte order of the platform currently running.
|
||||||
|
*/
|
||||||
public static ByteOrder nativeOrder ()
|
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()
|
public String toString()
|
||||||
{
|
{
|
||||||
return this == BIG_ENDIAN ? "BIG_ENDIAN" : "LITTLE_ENDIAN";
|
return this == BIG_ENDIAN ? "BIG_ENDIAN" : "LITTLE_ENDIAN";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue