I need to read a text file line by line using Java. I use available() method of FileInputStream to check and loop over the file. But while reading,
available()
FileInputStream
The reason your code skipped the last line was because you put fis.available() > 0 instead of fis.available() >= 0
fis.available() > 0
fis.available() >= 0