Java File to String fileToString(InputStream inputStream)

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

Description

file To String

License

Apache License

Declaration

public static String fileToString(InputStream inputStream) 

Method Source Code


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

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import java.util.stream.Collectors;

public class Main {
    public static String fileToString(InputStream inputStream) {
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        return bufferedReader.lines().collect(Collectors.joining(System.lineSeparator()));
    }/*from w ww .j av a  2s  .  c o  m*/
}

Related

  1. fileToString(File files[])
  2. fileToString(final File file)
  3. fileToString(final File file, final String charsetName)
  4. fileToString(final String filePath)
  5. fileToString(InputStream file)
  6. fileToString(String file)
  7. fileToString(String file)
  8. fileToString(String file)
  9. fileToString(String file, String encoding)