Android InputStream Read readStream(InputStream in)

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

Description

read Stream

Declaration

private static String readStream(InputStream in) throws IOException 

Method Source Code

//package com.java2s;

import java.io.*;

public class Main {
    private static String readStream(InputStream in) throws IOException {
        StringBuilder sb = new StringBuilder();
        BufferedReader r = new BufferedReader(new InputStreamReader(in),
                1024);/*w  w  w  .  ja v a  2  s . c  o m*/
        for (String line = r.readLine(); line != null; line = r.readLine()) {
            sb.append(line);
        }
        in.close();
        return sb.toString();
    }
}

Related

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