Here you can find the source of convertStreamToString(java.io.InputStream is)
public static String convertStreamToString(java.io.InputStream is)
//package com.java2s; public class Main { public static String convertStreamToString(java.io.InputStream is) { java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A"); return s.hasNext() ? s.next() : ""; }/*from ww w .j a v a2 s .c o m*/ }