Java BufferedReader back to the top of a text file?

前端 未结 5 1107
栀梦
栀梦 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:19

    "The whole business about mark() and reset() in BufferedReader smacks of poor design."

    why don't you extend this class and have it do a mark() in the constructor() and then do a seek(0) in topOfFile() method.

    BR,
    ~A

提交回复
热议问题