Here you can find the source of readAll(Reader rd)
private static String readAll(Reader rd) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.Reader; public class Main { /**For reading the JSON*/ private static String readAll(Reader rd) throws IOException { StringBuilder sb = new StringBuilder(); int cp;//from w w w. j a v a 2 s.co m while ((cp = rd.read()) != -1) { sb.append((char) cp); } return sb.toString(); } }