Java BufferedReader Read loadInputStream(InputStream inputStream)

Here you can find the source of loadInputStream(InputStream inputStream)

Description

load Input Stream

License

Open Source License

Declaration

public static String loadInputStream(InputStream inputStream) 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 loadInputStream(InputStream inputStream) throws IOException {
        StringBuffer result = new StringBuffer();
        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));

        String line = reader.readLine();
        while (line != null) {
            result.append(line).append('\n');
            line = reader.readLine();/*from w  w w.j a va 2s. com*/
        }

        inputStream.close();

        return result.toString();
    }
}

Related

  1. loadCsvFile(String fileWithPath, String delimiter)
  2. loadDataURLs(File f, Pattern p)
  3. loadDict(InputStream io, boolean case_sensitive)
  4. loadEnrichmentHits(File file)
  5. loadIgnorList()
  6. loadInt(BufferedReader br)
  7. loadIntegersFromFile(String filename)
  8. loadIntoString(InputStream is)
  9. loadJCC()