public static String toString(final InputStream input, final Charset encoding) throws IOException {
        final StringBuilderWriter sw = new StringBuilderWriter();
        copy(input, sw, encoding);
        return sw.toString();
    }
Gets the contents of an <code>InputStream</code> as a String
using the specified character encoding.
<p>
This method buffers the input internally, so there is no need to use a
<code>BufferedInputStream</code>.
</p>

@param input the <code>InputStream</code> to read from
@param encoding the encoding to use, null means platform default
@return the requested String
@throws NullPointerException if the input is null
@throws IOException          if an I/O error occurs
replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/utils/IOUtils.java