Code example for CharArrayWriter

Methods: toCharArray

    private Reader merge(Reader reader, TemplatingContext context, String name)
        throws MergingException 
        CharArrayWriter cw = new CharArrayWriter();
        templating.merge(context, reader, cw, name);
        return new CharArrayReader(cw.toCharArray());
     * Loads a single source file. 
     * @param reader the reader to read file contents from. 
     * @throws Exception if the file is invalid. 
    protected abstract void load(Reader reader)
        throws Exception;