Java BufferedReader back to the top of a text file?

前端 未结 5 1114
栀梦
栀梦 2020-11-30 09:47

I currently have 2 BufferedReaders initialized on the same text file. When I\'m done reading the text file with the first BufferedReader, I use the

5条回答
  •  南笙
    南笙 (楼主)
    2020-11-30 10:18

    The best way to proceed is to change your algorithm, in a way in which you will NOT need the second pass. I used this approach a couple of times, when I had to deal with huge (but not terrible, i.e. few GBs) files which didn't fit the available memory.

    It might be hard, but the performance gain usually worths the effort

提交回复
热议问题