Java InputStream to String inputStream2String(InputStream is)

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

Description

input Stream String

License

Open Source License

Declaration

public static String inputStream2String(InputStream is) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    public static String inputStream2String(InputStream is) {
        BufferedReader in = new BufferedReader(new InputStreamReader(is));
        StringBuffer buffer = new StringBuffer();
        String line = "";
        try {/*www  .j a v a 2s .  c  om*/
            while ((line = in.readLine()) != null) {
                buffer.append(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return buffer.toString();
    }
}

Related

  1. InputStream2String(InputStream in_st, String charset)
  2. inputStream2String(InputStream inputstream)
  3. inputStream2String(InputStream inStream)
  4. inputStream2String(InputStream is)
  5. inputStream2String(InputStream is)
  6. inputStream2String(InputStream is)
  7. inputStream2String(InputStream source)
  8. inputstream_to_string(InputStream in)
  9. inputStreamAsString(InputStream is)