Here you can find the source of load(File file)
public static String load(File file)
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; public class Main { public static String load(File file) { try {/*from w w w . jav a2s .c o m*/ BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8")); String s = ""; while (true) { String s1 = reader.readLine(); if (s1 == null) break; s += s1; } reader.close(); return s; } catch (Exception e) { e.printStackTrace(); return null; } } }