How to get the content of an InputStream as a String?
We can use the code below to convert the content of an
InputStream into a
String. At first we use
FileInputStream create to a connection to a file that going to be read.
IOUtils.toString(InputStream input, String encoding) method gets the content of the
InputStream and returns a string representation of it. In the end we need to close the
InputStream in a finally block.