通过BufferedReader读取输入Stream To String
/**来自 时 代 J a v a**/ import org.apache.log4j.Logger; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Collection; public class Main{ private final static Logger log = Logger.getLogger(StringUtil.class); public static String inputStreamToString(final InputStream inputStream) { final BufferedReader br = new BufferedReader(new InputStreamReader( inputStream)); final StringBuilder sb = new StringBuilder(); //来 自 nowjava.com - 时 代 Java try { while (br.ready()) { sb.append(br.readLine()); } } catch (IOException e) { log.error("can't read line from buffered reader", e); } finally {