Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs. The offset may be set beyond the end of the file. Setting the offset beyond the end of the file does not change the file length. The file length will change only by writing after the offset has been set beyond the end of the file.
Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
Originally posted by Marco Tedone:
Hi, while waiting for my exam, I'm reading post here and there. I
learnt from George most on what I'll need to write in order to read the db
infos. There will be a file with metadata, headers and actual data,
keeping to same formats and lenght it will be possible to read in a loop
(at the end it's this that we want) the data, using RandomAccessFile is
recommended. I'm encountering in numerous posts the RAF.seek() method. I
would like to explain as my defence that I am not english-mother-language.
I had a look a the documentation for this method and it sais:
I didn't understand a lot of it.
If I've got (in bytes):
1234 6789 ABC
If I perform RAF.seek(4), will the pointer be before '6'? Probably there
will be something wrong in what I've just asked,, but anyway, what's the
utility of using seek() (Please note this is not a critizism of the
method, it's just that I would like to know how to get advantage of it for
my SCJD exam!).
Thanks for any help,
Marco
Regards, George
SCJP, SCJD, SCWCD, SCBCD
SCJP<br />SCJD
SCJP<br />SCJD
Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
If I've got (in bytes):
1234 6789 ABC
If I perform RAF.seek(4), will the pointer be before '6'?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
You learn how to close your eyes and tell yourself "this just isn't really happening to me." Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|