public static String[] readFile(String networkEngineToConfig) throws IOException {
  ArrayList<String> ret=new ArrayList<String>();
  InputStream inStream=new FileInputStream(networkEngineToConfig);
  InputStreamReader inFile=new InputStreamReader(inStream);
  BufferedReader inBuf=new BufferedReader(inFile);
  String line;
  while ((line=inBuf.readLine()) != null)   ret.add(line);
  inBuf.close();
  return ret.toArray(new String[ret.size()]);
}

public static String [ ] readFile ( String networkEngineToConfig ) throws IOException { ArrayList < String > ret = new ArrayList < String > ( ) ; InputStream inStream = new FileInputStream ( networkEngineToConfig ) ; InputStreamReader inFile = new InputStreamReader ( inStream ) ; BufferedReader inBuf = new BufferedReader ( inFile ) ; String line ; while ( ( line = inBuf . readLine ( ) ) != null ) ret . add ( line ) ; inBuf . close ( ) ; return ret . toArray ( new String [ ret . size ( ) ] ) ; }
read a text file . return string array with one string per line .
