Package com.opensymphony.module.sitemesh.filter

# Class Buffer

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

public class Buffer extends 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

Fields
Modifier and Type
Field
Description
`private FastByteArrayOutputStream`
`bufferedStream`
`private CharArrayWriter`
`bufferedWriter`
`private final String`
`encoding`
`private javax.servlet.ServletOutputStream`
`exposedStream`
`private PrintWriter`
`exposedWriter`
`private final PageParser`
`pageParser`
`private static final TextEncoder`
`TEXT_ENCODER`

## Constructor Summary

Constructors
Constructor
Description
`Buffer(PageParser pageParser, String encoding)`

## Method Summary

Modifier and Type
Method
Description
`char[]`
`getContents()`
`javax.servlet.ServletOutputStream`
`getOutputStream()`
`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 Details

### pageParser

private final PageParser pageParser

### encoding

private final String encoding

### TEXT_ENCODER

private static final TextEncoder TEXT_ENCODER

### bufferedWriter

private CharArrayWriter bufferedWriter

### bufferedStream

private FastByteArrayOutputStream bufferedStream

### exposedWriter

private PrintWriter exposedWriter

### exposedStream

private javax.servlet.ServletOutputStream exposedStream

## Constructor Details

### Buffer

public Buffer(PageParser pageParser, String encoding)

## Method Details

### getContents

public char[] getContents() throws IOException

Throws:
  `IOException`

### parse

public Page parse() throws IOException

Throws:
  `IOException`

### getWriter

public PrintWriter getWriter()

### getOutputStream

public javax.servlet.ServletOutputStream getOutputStream()

### isUsingStream

public boolean isUsingStream()