class WebUtils {

    protected static String createString (InputStream in, String encoding) throws IOException {
        encoding = encoding == null ? "UTF-8" : encoding;

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        byte[] buf = new byte[8192];
        int len = 0;

        while ((len = in.read(buf)) != -1) {
            baos.write(buf, 0, len);
        }

        return new String(baos.toByteArray(), encoding);
    }

    protected  WebUtils();

}