Here you can find the source of readAll(Reader reader)
public static String readAll(Reader reader) throws IOException
//package com.java2s; //License from project: Apache License import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; public class Main { public static String readAll(InputStream stream) throws IOException { Reader reader = new BufferedReader(new InputStreamReader(stream)); return readAll(reader); }/*from www .j a v a2 s . co m*/ public static String readAll(Reader reader) throws IOException { StringBuilder buf = new StringBuilder(); int in; while ((in = reader.read()) != -1) { char ch = (char) in; buf.append(ch); } return buf.toString(); } }