1

I was looking at this question - Reset buffer with BufferedReader in Java? - which says that you can reset the buffer by calling:

fIn.getChannel().position(0);

But what if we are using the Apache Commons IO ReversedLinesFileReader class? Is there a way to simulate a similar action?

Community
  • 1
  • 1
Caffeinated
  • 11,982
  • 40
  • 122
  • 216
  • 1
    Sounds like something you could suggest on their issue tracker. The internal structure seems rather complicated and you would need to hack around it with reflection. – randers Feb 16 '16 at 00:53
  • 1
    The question you cited was very poorly expressed. You can reset the underlying *file* that way, but whatever was buffered is still buffered. You need to clarify your question similarly. Do you want to reread the entire file, or only the current buffer? – user207421 Feb 16 '16 at 02:11
  • @EJP - I'd like to reread only the current buffer , thanks – Caffeinated Feb 18 '16 at 01:41

0 Answers0