Java Inputstream to String

A nice way to do this is using Apache commons IOUtils to copy the InputStream into a StringWriter

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

http://stackoverflow.com/questions/309424/read-convert-an-inputstream-to-a-string