Here you can find the source of valueOf(InputStream is)
public static String valueOf(InputStream is)
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.InputStream; public class Main { public static String valueOf(InputStream is) { try {//from w ww . j a v a 2s. co m int i = -1; byte[] b = new byte[1024 * 100]; StringBuffer sb = new StringBuffer(); while ((i = is.read(b)) != -1) { sb.append(new String(b, 0, i)); } String content = sb.toString(); return content; } catch (IOException e) { e.printStackTrace(); return null; } } }