🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

c int conversion to java short?

#16759
From: Michael Appelmans
Date: Wed, 27 Jan 1999 00:00
16 lines
1039 bytes
When passing a byte stream over tcp/ip sockets we are receiving a byte
array of 2 byte signed "C" integers. Is there a way to convert them to
Java short without byte swapping and bit twidling? I see
DataInputStream has readUnsignedShort() but this won't handle signed
integers?

What happens when we get to floats,doubles etc with regard to negative
numbers?

Thanks

Michael Appelmans

Agility, Inc.
*SpamBam - remove 123 to mail*
mappelmans@123agility-inc.com
Technical Details
Message-ID: <78nekk$2db4@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,c96c9cc1aedc281b,start
X-Google-Attributes: gidf74b3,public
From: "Michael Appelmans" <mappel@123ibm.net>
Subject: c int conversion to java short?
Date: 1999/01/27
Message-ID: <78nekk$2db4@forums.borland.com>
X-Deja-AN: 437571974
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="iso-8859-1"
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language