Here you can find the source of load(InputStream is)
private static String load(InputStream is) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; public class Main { private static final String NEW_LINE = System.getProperty("line.separator"); private static String load(InputStream is) throws IOException { try (BufferedReader in = new BufferedReader(new InputStreamReader(is))) { String line;/*from ww w . j a v a 2 s .co m*/ StringBuilder responseData = new StringBuilder(); while ((line = in.readLine()) != null) { responseData.append(line).append(NEW_LINE); } return responseData.toString(); } } }