Android InputStream Read readTextInputStream(InputStream is)

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

Description

read Text Input Stream

Declaration

public static String readTextInputStream(InputStream is)
            throws IOException 

Method Source Code

//package com.java2s;

import java.io.*;

public class Main {
    public static String readTextInputStream(InputStream is)
            throws IOException {
        if (null == is)
            return null;
        StringBuffer strbuffer = new StringBuffer();
        String line;/*from w  w  w.  j  a v a  2 s. c om*/
        BufferedReader reader = null;
        try {
            reader = new BufferedReader(new InputStreamReader(is));
            while ((line = reader.readLine()) != null) {
                strbuffer.append(line).append("\r\n");
            }
        } finally {
            if (reader != null) {
                reader.close();
            }
        }
        return strbuffer.toString();
    }
}

Related

  1. readInputStreamContent(InputStream inputStream)
  2. readInt(InputStream stream)
  3. readLong(InputStream in, final int fitInBytes)
  4. readShort(InputStream stream)
  5. readStringFromInputStream(InputStream is)
  6. readData(InputStream inSream, String charsetName)
  7. skip(InputStream stream, int numBytes)
  8. dealResponseResult(InputStream in)
  9. getInputStreamFromUrl_V9( Context paramContext, String paramString)