How to convert InputStream to String in Java?
/** * */ package convert.stream.to.string; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; /** * @author abdul * */ public class StreamToString { /** * @param args */ public static void main(String[] args) { StreamToString streamToString = new StreamToString(); //intilize an InputStream InputStream is = new ByteArrayInputStream("file content:\nData1\nData2".getBytes()); /* * Call the method to convert the stream to string */ ...