Java examples for File Path IO:File Stream
read String From Stream
//package com.java2s; import java.io.*; public class Main { public static String readStringFromStream(InputStream inputStream) { String text;/* w w w .jav a 2 s. co m*/ InputStreamReader reader = new InputStreamReader(inputStream); try { text = getString(reader); } catch (IOException e) { throw new RuntimeException(e); } return text; } private static String getString(Reader reader) throws IOException { String text = ""; BufferedReader bufferedReader = new BufferedReader(reader); String line; while ((line = bufferedReader.readLine()) != null) { text += line + "\n"; } return text; } }