[5663] in java-interest

home help back first fref pref prev next nref lref last post

Re: How to swaps high and low bytes of a two byte short under

daemon@ATHENA.MIT.EDU (eric@onshore.com)
Wed Feb 21 15:45:47 1996

From: eric@onshore.com
Date: Wed, 21 Feb 1996 13:10:25 -0600
To: Xing.Jing@cs.cmu.edu,
        Outbound News <outnews+netnews.comp.lang.java@andrew.cmu.edu>,
        java-interest@java.sun.com

At 06:41 PM 2/20/96 -0500, Xing.Jing@cs.cmu.edu wrote:
>Hi,
>Does anybody know how to swaps high and low bytes of a two byte short 
>under Java? My JAVA code needs to read a data file stored in a two byte 
>short, but its byte order is different with that of java "readShort()".
>
>Any suggestion would be great appreciate. 

Hi,

Well, you should be able to use bitwise "AND" and "OR" and/or bit shifting
to get a routine to do this.

Eric

-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post