🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #19784

Re: Endian

#19784
From: Paul Whittington
Date: Mon, 15 Dec 1997 00:00
41 lines
1668 bytes
This is a multi-part message in MIME format.
--------------E93FA8A215B13AB7078F97C8
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

You could try like:

byte[] binaryData = new byte[2];
short s = (short)(0xFFFF & ((0xFF & binaryData[0]) | (0xFF00 &
(binaryData[1] << 8))));

Jon C. wrote:

> I'm attempting to read some 16 bit signed numbers from a binary file.
> Is there any provisions in Java for swapping byte positions or
> conversions??
>
> Jon Clayton



--------------E93FA8A215B13AB7078F97C8
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Paul Whittington
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Paul Whittington
n:              Whittington;Paul
org:            Idaho National Engineering and Environmental Laboratory
email;internet: paul@sage.inel.gov
title:          Advisory Engineer
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard


--------------E93FA8A215B13AB7078F97C8--
Technical Details
Message-ID: <349555EC.F869FAF0@sage.inel.gov>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <01bd08ef$823ec680$514194ce@dell-266>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,b0ea169c1f5bab81
X-Google-Attributes: gidf74b3,public
From: Paul Whittington <paul@sage.inel.gov>
Subject: Re: Endian
Date: 1997/12/15
Message-ID: <349555EC.F869FAF0@sage.inel.gov>
X-Deja-AN: 298391698
References: <01bd08ef$823ec680$514194ce@dell-266>
Content-Type: multipart/mixed; boundary="------------E93FA8A215B13AB7078F97C8"
Organization: Idaho National Engineering and Environmental Laboratory
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language