Code example for CharArrayWriter

0
    private CharArrayWriter bufferedWriter;
 
    public AppResponseWrapper(HttpServletResponse response) {
        super(response);
        // 保存返回结果 
        bufferedWriter = new CharArrayWriter();
        // 包装PrintWriter,让所有结果通过这个PrintWriter写入到bufferedWriter中 
        cachedWriter = new PrintWriter(bufferedWriter);
    } 
 
    @Override 
    public PrintWriter getWriter() {
        return cachedWriter;
    } 
 
    /** 
     * 获取原始的HTML页面内容。 
     *  
     * @return 
     */ 
    public String getResult() {