aliocrlib/src/main/java/com/lib/aliocr/utils/io/IOUtils.java
/**
     * Convert the specified string to an input stream, encoded as bytes
     * using the specified character encoding.
     * <p/>
     * Character encoding names can be found at
     * <a href="http://www.iana.org/assignments/character-sets">iaNa</a>.
     *
     * @param input    the string to convert
     * @param encoding the encoding to use, null means platform default
     * @return an input stream
     * @throws IOException                                  if the encoding is invalid
     * @throws java.nio.charset.UnsupportedCharsetException thrown instead of {@link UnsupportedEncodingException} in version 2.2 if the encoding is not
     *                                                      supported.
     * @since 1.1
     */
Convert the specified string to an input stream, encoded as bytes
using the specified character encoding.

Character encoding names can be found at
iaNa.


Convert the specified string to an input stream encoded as bytes using the specified character encoding . Character encoding names can be found at iaNa .
@SuppressWarnings("RedundantThrows")
    public static InputStream toInputStream(String input, String encoding) throws IOException {
        byte[] bytes = StringCodingUtils.getBytes(input, Charsets.toCharset(encoding));
        return new ByteArrayInputStream(bytes);
    }
@ SuppressWarnings ( "RedundantThrows" ) public static InputStream toInputStream ( String input , String encoding ) throws IOException { byte [ ] bytes = StringCodingUtils . getBytes ( input , Charsets . toCharset ( encoding ) ) ; return new ByteArrayInputStream ( bytes ) ; }
Convert the specified string to an input stream, encoded as bytes
 using the specified character encoding.
Convert the specified string to an input stream encoded as bytes using the specified character encoding .