public static InputStream toInputStream(String input, Charset encoding) {
        return new ByteArrayInputStream(input.getBytes(Charsets.toCharset(encoding)));
    }
Convert the specified string to an input stream, encoded as bytes
using the specified character encoding.

@param input    the string to convert
@param encoding the encoding to use, null means platform default
@return an input stream
@since 2.3
pay-java-common/src/main/java/com/egzosn/pay/common/util/IOUtils.java