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

@param input the <code>Reader</code> to read from
@return the requested character array
@throws NullPointerException if the input is null
@throws IOException          if an I/O error occurs
@since 1.1
Get the contents of a <code > Reader< / code > as a character array . <p / > This method buffers the input internally so there is no need to use a <code > BufferedReader< / code > .