Here you can find the source of readLines(String filename)
public static String[] readLines(String filename) throws IOException
//package com.java2s; //License from project: Apache License import java.io.*; import java.util.*; public class Main { public static String[] readLines(String filename) throws IOException { List<String> result = new ArrayList<String>(); BufferedReader br = new BufferedReader(new FileReader(filename)); String strLine;/*from w ww . j a v a 2 s . co m*/ while ((strLine = br.readLine()) != null) { result.add(strLine); } br.close(); return result.toArray(new String[result.size()]); } }