How do I convert InputStream to String?

This example will show you how to convert an InputStream to String. In the code snippet below we read a data.txt file, could be from common folder or from inside a jar file.