Android InputStream to String Convert inputStreamToString(InputStream inputstream)

Here you can find the source of inputStreamToString(InputStream inputstream)

Description

input Stream To String

Declaration

public static String inputStreamToString(InputStream inputstream)
            throws IOException 

Method Source Code

//package com.java2s;
import java.io.*;

public class Main {
    public static String inputStreamToString(InputStream inputstream)
            throws IOException {
        InputStreamReader inputstreamreader = new InputStreamReader(
                inputstream);//from  w w  w  .  j a v  a 2 s. co m
        BufferedReader bufferedreader = new BufferedReader(
                inputstreamreader);
        StringBuilder stringbuilder = new StringBuilder();
        do {
            String s = bufferedreader.readLine();
            if (s != null) {
                String s1 = (new StringBuilder()).append(s).append("\n")
                        .toString();
                StringBuilder stringbuilder1 = stringbuilder.append(s1);
            } else {
                bufferedreader.close();
                return stringbuilder.toString();
            }
        } while (true);
    }
}

Related

  1. inStream2String(InputStream is)
  2. fromStream(InputStream inputStream)
  3. parseString(InputStream is)
  4. convertStreamToString(InputStream is)
  5. readToString(final InputStream inputStream)
  6. streamToString(InputStream is)
  7. inputStreamToString(InputStream is)
  8. inputStreamToString(InputStream stream)
  9. streamToString(InputStream in, String charset)