Here you can find the source of readLineFile(File file)
public static String[] readLineFile(File file) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; public class Main { public static String[] readLineFile(File file) throws IOException { BufferedReader a = null;/* ww w . j ava 2s . c o m*/ String[] d = null; try { a = new BufferedReader(new FileReader(file)); String b; int c = 0; String[] e = null; b = a.readLine(); while (b != null) { e = new String[c + 1]; if (d != null) { System.arraycopy(d, 0, e, 0, d.length); } else { d = new String[1]; } e[c] = b; d = e.clone(); c++; b = a.readLine(); } } finally { if (a != null) { a.close(); } } if (d != null) { return d.clone(); } else { return null; } } }