I am reading a 15 Million file using Java BUfferReader. In some conditions, I have to loop back 1000 lines in the buffer and RE-READ them, and then continuing them with the next records after those 1000. In simple words I want to be able to have full control over line number in the buffer during the loop.
1) The BufferReader.mark(1000000) and BufferReader.Reset() simply hangs in big files.
2) If I use Randomaccessfile, The seek() method requires an offset rather than a simple line number which makes the program complex.
So, what is the best way if I want to move back 1000 lines (again and again) if a certain condition arises.
THanks