0 works

Convert an InputStream into a String in Java


dashboard+ Project

Posted by @starbucks #java

Code snippet:

StringWriter writer = new StringWriter();
IOUtils.copy(inputStream, writer, encoding);
String theString = writer.toString();
content_copyCopy to Clipboard

More details:

You need to use Apache commons IOUtils.

Code snippet source:

https://stackoverflow.com/questions/309424/how-do-i-read-convert-an-inputstream-into-a-string-in-java

>> Browse more code snippets

more_vert