Java examples for java.io:InputStream Read
get String in lines from InputStream
//package com.java2s; import java.io.*; public class Main { public static String getString(InputStream in) throws IOException { BufferedReader reader = new BufferedReader( new InputStreamReader(in)); StringBuilder builder = new StringBuilder(); String line;/*from w w w. jav a 2 s.c o m*/ while ((line = reader.readLine()) != null) { builder.append(line); builder.append(System.getProperty("line.separator")); } return builder.toString(); } }