Code example for CharArrayWriter

Methods: toCharArray

0
            writer = new CharArrayWriter();
            return writer;
        } 
 
        @Override public char[] getChars() throws Exception { 
            return writer.toCharArray();
        } 
    } 
 
    private static class PipedWriterCharSinkTester extends CharSinkTester { 
 
        private ExecutorService executor;
        private Future<char[]> future;
 
        public Writer create() throws IOException {
            final PipedReader in = new PipedReader();
            PipedWriter out = new PipedWriter(in);
 
            executor = Executors.newSingleThreadExecutor();
            future = executor.submit(new Callable<char[]>() {
                final CharArrayWriter chars = new CharArrayWriter();