Here you can find the source of readAllQuietly(Reader reader)
public static String readAllQuietly(Reader reader)
//package com.java2s; /*//from www . j a v a 2 s. co m * Author: David Corbin * * Copyright (c) 2005 RubyPeople. * * This file is part of the Ruby Development Tools (RDT) plugin for eclipse. * RDT is subject to the "Common Public License (CPL) v 1.0". You may not use * RDT except in compliance with the License. For further information see * org.rubypeople.rdt/rdt.license. */ import java.io.IOException; import java.io.Reader; public class Main { public static String readAllQuietly(Reader reader) { try { return readAll(reader); } catch (IOException e) { throw new RuntimeException(); } } public static String readAll(Reader reader) throws IOException { StringBuffer result = new StringBuffer(); char[] buffer = new char[1024]; while (true) { int bytesRead = reader.read(buffer); if (bytesRead <= 0) return result.toString(); result.append(buffer, 0, bytesRead); } } }