Here you can find the source of convertStreamToString(java.io.InputStream is)
static String convertStreamToString(java.io.InputStream is)
//package com.java2s; import java.util.Scanner; public class Main { static String convertStreamToString(java.io.InputStream is) { try {/* w w w .j a v a 2 s .c o m*/ return new Scanner(is).useDelimiter("\\A").next(); } catch (java.util.NoSuchElementException e) { return ""; } } }