Java : Read last n lines of a HUGE file

后端 未结 11 1786
温柔的废话
温柔的废话 2020-11-27 04:59

I want to read the last n lines of a very big file without reading the whole file into any buffer/memory area using Java.

I looked around the JDK APIs and Apache Com

11条回答
  •  天命终不由人
    2020-11-27 05:30

    CircularFifoBuffer from apache commons . answer from a similar question at How to read last 5 lines of a .txt file into java

    Note that in Apache Commons Collections 4 this class seems to have been renamed to CircularFifoQueue

提交回复
热议问题