Here you can find the source of readLines(String filename)
public static List<String> readLines(String filename) throws IOException
//package com.java2s; //License from project: LGPL import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List; public class Main { public static List<String> readLines(String filename) throws IOException { BufferedReader br = new BufferedReader(new FileReader(filename)); ArrayList<String> res = new ArrayList<String>(); while (br.ready()) { res.add(br.readLine());//from w w w.j a v a 2 s . c o m } br.close(); return res; } }