Here you can find the source of load(String fileName)
public static char[] load(String fileName)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static char[] load(String fileName) { File file = new File(fileName); final int size = (int) file.length(); char[] buffer = new char[size]; try (InputStreamReader in = new InputStreamReader(new FileInputStream(file))) { int readSize = in.read(buffer); if (readSize < size) { buffer = Arrays.copyOf(buffer, readSize); }//from ww w . j a va 2 s .co m return buffer; } catch (IOException e) { } return null; } }