Java Integer Array to String inputStreamToStr(InputStream is)

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

Description

input Stream To Str

License

Apache License

Declaration

public static String inputStreamToStr(InputStream is) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.BufferedReader;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class Main {
    public static String inputStreamToStr(InputStream is) throws IOException {

        BufferedReader bin = null;
        StringBuilder sin = new StringBuilder();

        String line;/*  ww w  .  j  av a 2 s  .c  o m*/
        try {
            bin = new BufferedReader(new InputStreamReader(is));
            while ((line = bin.readLine()) != null) {
                sin.append(line + "\n");
            }

        } finally {
            if (bin != null)
                bin.close();
        }

        return sin.toString();

    }
}

Related

  1. arrayIntToString(int[] arrayInt)
  2. convertIntArrayToString(int[] data)
  3. convertIntArrayToString(int[] data)
  4. convertIntArrayToString(int[] value, String separator)
  5. inputStreamToStr(InputStream is)
  6. intArray2string(int intarr[])
  7. intArray2String(int[] value)
  8. intArray2String(int[] xs)
  9. intArrayAsString(int[] a)