我正在使用 BufferedReader 从文件中读取文本,当某些条件评估为 true 时,我想回滚到上一行。
最佳答案
将您的读者包裹在 PushbackReader 中.
来自javadoc:
A character-stream reader that allows characters to be pushed back into the stream.
关于java BufferedReader 回滚到上一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24401160/