Here you can find the source of readLines(String file)
public static List<String> readLines(String file) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class Main { public static List<String> readLines(String file) throws IOException { BufferedReader reader = null; List<String> lines; String line;/*from w w w. j a v a 2 s.c om*/ lines = new ArrayList<String>(); try { reader = new BufferedReader(new InputStreamReader( new FileInputStream(file))); while ((line = reader.readLine()) != null) lines.add(line); } finally { if (reader != null) reader.close(); } return lines; } }