Here you can find the source of dumpInputStream(InputStream stream)
static void dumpInputStream(InputStream stream)
//package com.java2s; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; public class Main { static void dumpInputStream(InputStream stream) { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(stream)); String line;/*from w w w .j a va 2s . c o m*/ try { while ((line = bufferedReader.readLine()) != null) { System.out.println(line); } } catch (IOException e) { e.printStackTrace(); } } }