Java tutorial
//package com.java2s; import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; public class Main { public static String inputStreamToString(InputStream inputStream) throws IOException { StringWriter sw = new StringWriter(); int c; InputStream in = inputStream; while ((c = in.read()) != -1) { sw.write(c); } return sw.toString(); } }