Convert Stream to String with Java

On March 29, 2013, in Java, Programming, by LuCuS

Convert stream to string with Java.

	public static String convertStreamToString(InputStream is)
	    Scanner s = new Scanner(is).useDelimiter("\\A");
	    String output = s.hasNext() ? : "";
	    return output;

Thank you for your interest in my site. If you find the information provided on this site useful, please consider making a donation to help continue development!

PayPal will open in a new tab.

Related Posts

Tagged with:  

Leave a Reply