Here you can find the source of readLines(String fullFileName)
public static String readLines(String fullFileName) throws IOException
//package com.java2s; //License from project: Apache License import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; public class Main { public static String readLines(String fullFileName) throws IOException { FileReader fr = null;/*from w w w . j a v a 2 s . c om*/ BufferedReader br = null; try { File file = new File(fullFileName); fr = new FileReader(file); br = new BufferedReader(fr); String line = null; StringBuffer sb = new StringBuffer(); while ((line = br.readLine()) != null) { sb.append(line); sb.append("\n"); } return sb.toString(); } finally { if (br != null) { br.close(); } if (fr != null) { fr.close(); } } } }