Here you can find the source of getResponseBody(InputStream inputStream)
Parameter | Description |
---|---|
inputStream | a parameter |
public static String getResponseBody(InputStream inputStream)
//package com.java2s; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; public class Main { /**//from ww w. j a v a2 s. c o m * static utility class to get response String from InputStream * @param inputStream * @return String */ public static String getResponseBody(InputStream inputStream) { String responseString = ""; try { BufferedReader in = new BufferedReader(new InputStreamReader( inputStream)); String myString = ""; while ((myString = in.readLine()) != null) responseString += myString; in.close(); } catch (IOException e) { e.printStackTrace(); } return responseString; } }