K
Kevin
Hi,
I am kind of new at this topic, but does anyone know that: is Java's
Random Access File really "random access", or just java "simulate" it
for newbie coders' easy coding?
The difference is, for example, for a 100G file of many records, if the
access to it is a REAL random access, then accessing any of its record
will use almost the same time (and fast): accessing the first record
will use the same time as accessing its 100th record, 1000000th record,
etc., and all should be fast and use little resource.
So I think it comes down to how the "seek(position)" work. Will it:
1) just read forward/backward to the postion?
or
2) it "jump" to that position directly?
blocks of this file, so java can read in those "informative" blocks
that keep information of those data blocks, and do the calculate to
know which data block is the required one and read that block directly.
Am I right at this point? Why I saw some articles say something like
"since random access file needs to access the underlying OS, so its
performance is not so good"?
Thank you.
I am kind of new at this topic, but does anyone know that: is Java's
Random Access File really "random access", or just java "simulate" it
for newbie coders' easy coding?
The difference is, for example, for a 100G file of many records, if the
access to it is a REAL random access, then accessing any of its record
will use almost the same time (and fast): accessing the first record
will use the same time as accessing its 100th record, 1000000th record,
etc., and all should be fast and use little resource.
So I think it comes down to how the "seek(position)" work. Will it:
1) just read forward/backward to the postion?
or
2) it "jump" to that position directly?
file's header will keep a linked list (or pointers, whatever) of theFrom my limited knowledge, I think they can do it this way: since each
blocks of this file, so java can read in those "informative" blocks
that keep information of those data blocks, and do the calculate to
know which data block is the required one and read that block directly.
Am I right at this point? Why I saw some articles say something like
"since random access file needs to access the underlying OS, so its
performance is not so good"?
Thank you.