Android InputStream Read readStream(InputStream in)

Here you can find the source of readStream(InputStream in)

Description

read Stream

Declaration

public static String readStream(InputStream in) 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 readStream(InputStream in) throws IOException {
        StringBuilder sb = new StringBuilder();
        BufferedReader r = new BufferedReader(new InputStreamReader(in),
                1024);//ww w  . ja v  a 2 s . c  om
        for (String line = r.readLine(); line != null; line = r.readLine()) {
            sb.append(line);
        }
        in.close();
        return sb.toString();
    }
}

Related

  1. readFully(InputStream in)
  2. readInputStreamToString(InputStream input, String enCoding)
  3. writeToStream(InputStream in, OutputStream out, boolean closeOnExit)
  4. readStream(InputStream in)
  5. readStream(InputStream in)
  6. readToFile(InputStream in, File localFile)
  7. readAllAndClose(InputStream is)
  8. readAllBytes(InputStream in)
  9. readAllBytesToOutput(InputStream is, OutputStream output)