permaculture playing cards*
The moose likes Beginning Java and the fly likes Avoiding File Access Multiple Times. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Avoiding File Access Multiple Times." Watch "Avoiding File Access Multiple Times." New topic

Avoiding File Access Multiple Times.

Nathan Heimdall

Joined: Mar 02, 2009
Posts: 20
I have a program which reads data from a file several times consecutively.

It accesses the same file each time for a different operation which is causing the program to run very slowly.

Is there any way I can avoid having to read it several times and get copy which I can access faster?


"A single conversation with a wise man is better than ten years of study."
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10172

What type of file is it? What kind of data?
One way to do it is cache it in memory if possible.

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Consider Paul's rocket mass heater.
subject: Avoiding File Access Multiple Times.
Similar Threads
How can I test to see if an object exists (yet)?
Requested resource is not available - how to correct
check efficiency
How data stored in Database
java io/reading from Disk file using RandomAccessFile class