Here you can find the source of readLines(File file)
public static String[] readLines(File file)
//package com.java2s; //License from project: Open Source License import java.io.*; import java.util.*; public class Main { public static String[] readLines(File file) { try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file)))) { ArrayList<String> res = new ArrayList<>(); String line;//w w w .j a v a 2 s .com while ((line = in.readLine()) != null) res.add(line); return res.toArray(new String[0]); } catch (IOException e) { return null; } } public static String[] readLines(String file) { return readLines(new File(file)); } }