Java tutorial
import java.io.BufferedReader; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; public class Main { public static void main(String[] argv) throws Exception { BufferedReader reader = Files.newBufferedReader(Paths.get("a.bat"), StandardCharsets.UTF_8); //BufferedReader's lines methods returns a stream of all lines reader.lines().forEach(System.out::println); } }