Here you can find the source of readAll(final Reader reader)
public static String readAll(final Reader reader) throws IOException
//package com.java2s; // The MIT License import java.io.BufferedReader; import java.io.IOException; import java.io.Reader; public class Main { public static String readAll(final Reader reader) throws IOException { final StringBuffer buffer = new StringBuffer(); final BufferedReader in = new BufferedReader(reader); int ch;/*w ww.j a va2 s. co m*/ while ((ch = in.read()) > -1) { buffer.append((char) ch); } in.close(); return buffer.toString(); } }