Here you can find the source of getStringArrayFromFile(File inputFile)
public static String[] getStringArrayFromFile(File inputFile) throws IOException
//package com.java2s; import java.io.*; import java.util.ArrayList; public class Main { public static String[] getStringArrayFromFile(File inputFile) throws IOException { ArrayList list = new ArrayList(); BufferedReader br = new BufferedReader(new FileReader(inputFile)); while (true) { String line = br.readLine(); if (line == null) break; list.add(line);/*from ww w . ja v a 2s . co m*/ } br.close(); return (String[]) list.toArray(new String[0]); } }