🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

How to read an array of integers from a Random Access File

#16199
From: Dave Hopkins
Date: Wed, 17 Mar 1999 00:00
17 lines
1341 bytes
I would like to read an array of integer values ( or floats, etc) from a
RandomAccessFile.  However, the options for this type of file include an
array of bytes, or a single integer at a time.  I looked at the
tutorial  http://java.sun.com/docs/books/tutorial/ but now am even more
confused.  I'm guessing that it should be possible to read an array of
bytes, write them to some output stream (in memory?), and then
sequentially read my sequence of integers from an input stream connected
to the output stream?  All I know for certain is that reading 30000
integers from the file one at a time is very slow. Does anyone have any
idea how to implement this, or (even better?) point me to a reference
that discusses how to chain input/output streams to accomplish this.

Thanks,

Dave Hopkins
ARL
hopkins@arl.mil
Technical Details
Message-ID: <36EFFEC8.4AA650F@arl.mil>
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,68ccd52fdff2bf6,start
X-Google-Attributes: gidf74b3,public
From: Dave Hopkins <hopkins@arl.mil>
Subject: How to read an array of integers from a Random Access File
Date: 1999/03/17
Message-ID: <36EFFEC8.4AA650F@arl.mil>
X-Deja-AN: 455801517
Content-Transfer-Encoding: 7bit
Organization: Another Netscape Collabra Server User
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language