org.apache.myfaces.tobago.internal.util
Class ResponseWriterBuffer

java.lang.Object
  extended by org.apache.myfaces.tobago.internal.util.ResponseWriterBuffer

public class ResponseWriterBuffer
extends Object

Buffering scheme: we use a tremendously simple buffering scheme that greatly reduces the number of calls into the Writer/PrintWriter. In practice this has produced significant measured performance gains (at least in JDK 1.3.1). We only support adding single characters to the buffer, so anytime multiple characters need to be written out, the entire buffer gets flushed. In practice, this is good enough, and keeps the core simple.


Constructor Summary
ResponseWriterBuffer(Writer writer)
           
 
Method Summary
 void addToBuffer(char ch)
          Add a character to the buffer, flushing the buffer if the buffer is full, and returning the new buffer index
 void addToBuffer(char[] ch)
           
 void flushBuffer()
          Flush the contents of the buffer to the output stream and return the reset buffer index
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResponseWriterBuffer

public ResponseWriterBuffer(Writer writer)
Method Detail

addToBuffer

public void addToBuffer(char ch)
                 throws IOException
Add a character to the buffer, flushing the buffer if the buffer is full, and returning the new buffer index

Throws:
IOException

addToBuffer

public void addToBuffer(char[] ch)
                 throws IOException
Throws:
IOException

flushBuffer

public void flushBuffer()
                 throws IOException
Flush the contents of the buffer to the output stream and return the reset buffer index

Throws:
IOException


Copyright © 2002-2014 The Apache Software Foundation. All Rights Reserved.