Android InputStream to String Convert parseString(InputStream is)

Here you can find the source of parseString(InputStream is)

Description

parse String

Declaration

public static String parseString(InputStream is) 

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 parseString(InputStream is) {
        BufferedReader br = null;
        StringBuilder sb = new StringBuilder();

        String line;/*w w  w .  j a  v a 2s .c o  m*/
        try {

            br = new BufferedReader(new InputStreamReader(is));
            while ((line = br.readLine()) != null) {
                sb.append(line);
            }

        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

        return sb.toString();
    }
}

Related

  1. toConvertString(InputStream is)
  2. inStream2String(InputStream is)
  3. inputStream2String(InputStream is)
  4. inStream2String(InputStream is)
  5. fromStream(InputStream inputStream)
  6. convertStreamToString(InputStream is)
  7. readToString(final InputStream inputStream)
  8. inputStreamToString(InputStream inputstream)
  9. streamToString(InputStream is)