Here you can find the source of dealResponseResult(InputStream in)
public static String dealResponseResult(InputStream in)
//package com.java2s; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; public class Main { private static final String CHARSET = "utf-8"; public static String dealResponseResult(InputStream in) { try {/*from w w w . j a v a 2 s . co m*/ BufferedReader reader = new BufferedReader( new InputStreamReader(in, CHARSET)); StringBuilder sb = new StringBuilder(); String msg = null; while ((msg = reader.readLine()) != null) { sb.append(msg); } return sb.toString(); } catch (Exception e) { throw new RuntimeException(e); } finally { try { if (in != null) { in.close(); } } catch (IOException e) { throw new RuntimeException(e); } } } }