aliocrlib/src/main/java/com/lib/aliocr/utils/io/IOUtils.java
/**
     * Writes bytes from a <code>byte[]</code> to chars on a <code>Writer</code>
     * using the specified character encoding.
     * <p/>
     * This method uses {@link String#String(byte[], String)}.
     *
     * @param data     the byte array to write, do not modify during output,
     *                 null ignored
     * @param output   the <code>Writer</code> to write to
     * @param encoding the encoding to use, null means platform default
     * @throws NullPointerException if output is null
     * @throws IOException          if an I/O error occurs
     * @since 2.3
     */
Writes bytes from a byte[] to chars on a Writer
using the specified character encoding.


Writes bytes from a byte [] to chars on a Writer using the specified character encoding .
@SuppressLint("ObsoleteSdkInt")
    public static void write(byte[] data, Writer output, Charset encoding) throws IOException {
        if (data != null) {
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.GINGERBREAD) {
                output.write(new String(data, Charsets.toCharset(encoding).name()));
            } else {
                output.write(new String(data, Charsets.toCharset(encoding)));
            }
        }
    }
@ SuppressLint ( "ObsoleteSdkInt" ) public static void write ( byte [ ] data , Writer output , Charset encoding ) throws IOException { if ( data != null ) { if ( Build . VERSION . SDK_INT < Build . VERSION_CODES . GINGERBREAD ) { output . write ( new String ( data , Charsets . toCharset ( encoding ) . name ( ) ) ) ; } else { output . write ( new String ( data , Charsets . toCharset ( encoding ) ) ) ; } } }
Writes bytes from a <code>byte[]</code> to chars on a <code>Writer</code>
 using the specified character encoding.
Writes bytes from a <code > byte [] < / code > to chars on a <code > Writer< / code > using the specified character encoding .