com.opensymphony.module.sitemesh.filter
Class Buffer

java.lang.Object
  extended by com.opensymphony.module.sitemesh.filter.Buffer

public class Buffer
extends java.lang.Object

When SiteMesh is activated for a request, the contents of the response are stored in this buffer, where they can later be accessed as a parsed Page object.

Version:
$Revision: 1.3 $
Author:
Joe Walnes

Field Summary
private  FastByteArrayOutputStream bufferedStream
           
private  java.io.CharArrayWriter bufferedWriter
           
private  java.lang.String encoding
           
private  javax.servlet.ServletOutputStream exposedStream
           
private  java.io.PrintWriter exposedWriter
           
private  PageParser pageParser
           
private static TextEncoder TEXT_ENCODER
           
 
Constructor Summary
Buffer(PageParser pageParser, java.lang.String encoding)
           
 
Method Summary
 char[] getContents()
           
 javax.servlet.ServletOutputStream getOutputStream()
           
 java.io.PrintWriter getWriter()
           
 boolean isUsingStream()
           
 Page parse()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pageParser

private final PageParser pageParser

encoding

private final java.lang.String encoding

TEXT_ENCODER

private static final TextEncoder TEXT_ENCODER

bufferedWriter

private java.io.CharArrayWriter bufferedWriter

bufferedStream

private FastByteArrayOutputStream bufferedStream

exposedWriter

private java.io.PrintWriter exposedWriter

exposedStream

private javax.servlet.ServletOutputStream exposedStream
Constructor Detail

Buffer

public Buffer(PageParser pageParser,
              java.lang.String encoding)
Method Detail

getContents

public char[] getContents()
                   throws java.io.IOException
Throws:
java.io.IOException

parse

public Page parse()
           throws java.io.IOException
Throws:
java.io.IOException

getWriter

public java.io.PrintWriter getWriter()

getOutputStream

public javax.servlet.ServletOutputStream getOutputStream()

isUsingStream

public boolean isUsingStream()

www.opensymphony.com/sitemesh/