Is there any way to read file line by line using the Java nio package? How to use the nio classes to read file line by line?
The easiest way to read file line by line is to use the BufferedReader class. Check the tutorial Java Read File Line by Line - Java Tutorial.
If you start using the nio package to read the file then you will end up with lots of code the check the end of file "\n", "\r\n" etc.. You will have to also deal with the platform specification differences.