🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Java Guru Wanted!

#19725
From: Noah Clements
Date: Sat, 20 Dec 1997 00:00
42 lines
1597 bytes
Just a wanna-be, long-way-to-go-to-be here,

To concantenate four bytes into an integer, you can use the left shift
operator (<<) and add the results together.  I believe something like:

int i = (b[11] << 24) + (b[12] << 16) + .......

If you have a lot of this to do, you might use streams instead.

HTH, Noah
>
>Given the following Java code
>
>byte[] b = new byte[100];
>
>and assuming that at b[11] for four bytes you know there's a
>32-bit integer, how does one assign the integer at b[11] to
>an Integer object?
>
>
>
>--------------236EC2D2392B2863F066D1BC
>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
>
>
>--------------236EC2D2392B2863F066D1BC--
>
Technical Details
Message-ID: <349b917f.22934276@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <348D83B9.8B4F56DE@sage.inel.gov>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,a9c837252aa279c
X-Google-Attributes: gidf74b3,public
From: DELETE_THIS.2clem@concentric.net (Noah Clements)
Subject: Re: Java Guru Wanted!
Date: 1997/12/20
Message-ID: <349b917f.22934276@forums.borland.com>
X-Deja-AN: 308815541
References: <348D83B9.8B4F56DE@sage.inel.gov>
Organization: None
Newsgroups: borland.public.jbuilder.java.language