Back to project page Peterson.
The source code is released under:
GNU General Public License
If you think the Android project Peterson listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package tv.huohua.peterson.misc; /*from w ww . jav a2 s. c o m*/ import java.io.IOException; import java.io.InputStream; final public class IOUtils { public static String toString(final InputStream inputStream) throws IOException { byte[] bytes = new byte[1024]; StringBuilder builder = new StringBuilder(); int numRead = 0; while ((numRead = inputStream.read(bytes)) >= 0) { builder.append(new String(bytes, 0, numRead)); } return builder.toString(); } private IOUtils() { // TODO empty method } }