public static char[] toCharArray(InputStream is, Charset encoding)
            throws IOException {
        CharArrayWriter output = new CharArrayWriter();
        copy(is, output, encoding);
        return output.toCharArray();
    }
public static char[] toCharArray(InputStream is, Charset encoding)
            throws IOException {
        CharArrayWriter output = new CharArrayWriter();
        copy(is, output, encoding);
        return output.toCharArray();
    }
public static char [ ] toCharArray ( InputStream is , Charset encoding ) throws IOException { CharArrayWriter output = new CharArrayWriter ( ) ; copy ( is , output , encoding ) ; return output . toCharArray ( ) ; }
Get the contents of an <code>InputStream</code> as a character array
using the specified character encoding.
<p/>
This method buffers the input internally, so there is no need to use a
<code>BufferedInputStream</code>.

@param is       the <code>InputStream</code> to read from
@param encoding the encoding to use, null means platform default
@return the requested character array
@throws NullPointerException if the input is null
@throws IOException          if an I/O error occurs
@since 2.3
Get the contents of an <code > InputStream< / code > as a character array using the specified character encoding . <p / > This method buffers the input internally so there is no need to use a <code > BufferedInputStream< / code > .