Here you can find the source of inputStream2String(InputStream is)
public static String inputStream2String(InputStream is)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static String inputStream2String(InputStream is) { BufferedReader in = new BufferedReader(new InputStreamReader(is)); StringBuffer buffer = new StringBuffer(); String line = ""; try {/*www .j a v a 2s . c om*/ while ((line = in.readLine()) != null) { buffer.append(line); } } catch (IOException e) { e.printStackTrace(); } return buffer.toString(); } }