So I\'m having an issue reading a text file into my program. Here is the code:
try{ InputStream fis=new FileInputStream(targetsFile); Bu
In addition to the answer given by @ramin, if you already have BufferedReader or InputStream, it's possible to iterate through lines like this:
BufferedReader
InputStream
reader.lines().forEach(line -> { //... });
or if you need to process it with given order:
reader.lines().forEachOrdered(line -> { //... });