posted 17 years ago
There is a RandomAccessFile in the JDK, but it will only read "records" conveniently if they are all the same length. If you can pad fields and/or records to a fixed length, it will work great. Otherwise, probably not what you need.
Do you need to close the file between chunks? If not, you can just read 50 lines, leave the file open while you do something else, read 50 more and so on. If yes, you might try to compute how many bytes you have read in the first chunk, close the file while you do something else, open it again and Reader.skip() that many bytes before reading more. The only tricky bit there might be counting CR and/or LF characters ... linends are not always the same size.
Any of that sound useful?
[ March 08, 2007: Message edited by: Stan James ]
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi