Article View: borland.public.jbuilder.java.language
Article #16759c int conversion to java short?
From: Michael Appelmans
Date: Wed, 27 Jan 1999 00:00
Date: Wed, 27 Jan 1999 00:00
16 lines
1039 bytes
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-mailShow 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