public static void write(char[] data, OutputStream output, Charset encoding) throws IOException {
        if (data != null) {
            output.write(new String(data).getBytes(Charsets.toCharset(encoding)));
        }
    }
public static void write(char[] data, OutputStream output, Charset encoding) throws IOException {
        if (data != null) {
            output.write(new String(data).getBytes(Charsets.toCharset(encoding)));
        }
    }
public static void write ( char [ ] data , OutputStream output , Charset encoding ) throws IOException { if ( data != null ) { output . write ( new String ( data ) . getBytes ( Charsets . toCharset ( encoding ) ) ) ; } }
Writes chars from a <code>char[]</code> to bytes on an
<code>OutputStream</code> using the specified character encoding.
<p/>
This method uses {@link String#String(char[])} and
{@link String#getBytes(String)}.

@param data     the char array to write, do not modify during output,
null ignored
@param output   the <code>OutputStream</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 chars from a <code > char [] < / code > to bytes on an <code > OutputStream< / code > using the specified character encoding . <p / > This method uses { @link String#String ( char [] ) } and { @link String#getBytes ( String ) } .