Hey. For an arbitrary file (java) I want to count lines.
It is quite simple, for example, using the Apache FileUtils.readLines (...) method ...
However, for large files, reading the whole file in place is ridiculous (i.e. just for line counting).
One homegrown option: create a BufferedReader or use the FileUtils.lineIterator function and count the lines.
However, I assume that there may exist (with low memory) a modern API for performing simple large file operations with a minimal amount of boiler plate for java. Does any such library or functionality exist anywhere in any of Google, Apache, etc ... open source Java utilities?
source share