Android InputStream to String Convert convertInputStreamToString(InputStream inputStream)

Here you can find the source of convertInputStreamToString(InputStream inputStream)

Description

convert Input Stream To String

Declaration

public static String convertInputStreamToString(InputStream inputStream)
            throws IOException 

Method Source Code

//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 convertInputStreamToString(InputStream inputStream)
            throws IOException {
        BufferedReader bufferedReader = new BufferedReader(
                new InputStreamReader(inputStream));
        String line = "";
        String result = "";
        while ((line = bufferedReader.readLine()) != null)
            result += line;//from www . j ava  2 s . c  o m

        inputStream.close();
        return result;
    }
}

Related

  1. toStringBuffer(InputStream is)
  2. inputStream2String(InputStream in)
  3. inputStreamToString(InputStream in)
  4. inputStreamToString(InputStream is)
  5. InputStreamToString(InputStream stream)
  6. convertStreamToString(InputStream inputStream)
  7. convertStreamToString(InputStream inputStream)
  8. convertStreamToString(InputStream is)
  9. convertStreamToString(InputStream is)