Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Binary IO in RandomAccessFile super slow ?

794822Jul 6 2010 — edited Jul 8 2010
I have measured the time spent by a simple PUT in a binary RandomAccessFile:

I open it in this way:
Bin_file = new RandomAccessFile(path_fichero, "rws");}

and this is the 'Put' method called:
+public boolean Put(float value){ +
+ try {+
+ Bin_file.writeFloat(value);+
+ return true;+
+ } catch (IOException e) {+
+ e.printStackTrace();+
+ return false;+
+}+
+}+

ok, if I call Put 26000 times it spents 2 minutes
The same code in the old VisualBasic 6.0 spents 0.14 seconds

Any Idea ?
Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 5 2010
Added on Jul 6 2010
11 comments
1,109 views