Here you can find the source of appendFile(File f, StringBuffer sb)
public static void appendFile(File f, StringBuffer sb) throws IOException
//package com.java2s; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; public class Main { public static void appendFile(File f, StringBuffer sb) throws IOException { try {/* ww w.j a va 2 s . c o m*/ BufferedReader br = new BufferedReader(new FileReader(f)); char[] buffer = new char[1000]; int c = 0; while ((c = br.read(buffer)) > 0) { sb.append(buffer, 0, c); } } catch (IOException e) { throw (e); } } }