Java tutorial
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.io.InputStream; public class Main { public static String getInputStreamString(InputStream is) throws IOException { byte[] buffer = new byte[is.available()]; int len = is.read(buffer); return new String(buffer, 0, len, "utf-8"); } }