Java tutorial
//package com.java2s; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; public class Main { public static String getResponse(InputStream is) throws IOException { String nextLine; InputStreamReader isr = new InputStreamReader(is, "UTF-8"); BufferedReader bf = new BufferedReader(isr); StringBuilder response = new StringBuilder(); while ((nextLine = bf.readLine()) != null) { response.append(nextLine); } return response.toString(); } }