I need to read a large text file of around 5-6 GB line by line using Java.
How can I do this quickly?
You can use streams to do it more precisely:
Files.lines(Paths.get("input.txt")).forEach(s -> stringBuffer.append(s);