Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » catalina » connector » [javadoc | source]
org.apache.catalina.connector
public class: OutputBuffer [javadoc | source]
java.lang.Object
   java.io.Writer
      org.apache.catalina.connector.OutputBuffer

All Implemented Interfaces:
    ByteOutputChannel, Closeable, Flushable, Appendable

The buffer used by Tomcat response. This is a derivative of the Tomcat 3.3 OutputBuffer, with the removal of some of the state handling (which in Coyote is mostly the Processor's responsability).
Field Summary
public static final  String DEFAULT_ENCODING     
public static final  int DEFAULT_BUFFER_SIZE     
protected  HashMap encoders    List of encoders. 
protected  C2BConverter conv    Current char to byte converter. 
Constructor:
 public OutputBuffer() 
 public OutputBuffer(int size) 
Method from org.apache.catalina.connector.OutputBuffer Summary:
checkConverter,   clearEncoders,   close,   doFlush,   flush,   flushBytes,   getBufferSize,   getBytesWritten,   getCharsWritten,   getContentWritten,   getContentWrittenLong,   getResponse,   isClosed,   isNew,   isSuspended,   realWriteBytes,   recycle,   reset,   setBufferSize,   setConverter,   setEncoding,   setResponse,   setSuspended,   write,   write,   write,   write,   write,   write,   writeByte
Methods from java.io.Writer:
append,   append,   append,   append,   append,   append,   close,   flush,   write,   write,   write,   write,   write
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.connector.OutputBuffer Detail:
 public  void checkConverter() throws IOException 
 public  void clearEncoders() 
    Clear cached encoders (to save memory for Comet requests).
 public  void close() throws IOException 
    Close the output buffer. This tries to calculate the response size if the response has not been committed yet.
 protected  void doFlush(boolean realFlush) throws IOException 
    Flush bytes or chars contained in the buffer.
 public  void flush() throws IOException 
    Flush bytes or chars contained in the buffer.
 public  void flushBytes() throws IOException 
    Real write - this buffer will be sent to the client
 public int getBufferSize() 
 public int getBytesWritten() 
 public int getCharsWritten() 
 public int getContentWritten() 
 public long getContentWrittenLong() 
 public Response getResponse() 
    Get associated Coyote response.
 public boolean isClosed() 
    Is the response output closed ?
 public boolean isNew() 
    True if this buffer hasn't been used ( since recycle() ) - i.e. no chars or bytes have been added to the buffer.
 public boolean isSuspended() 
    Is the response output suspended ?
 public  void realWriteBytes(byte[] buf,
    int off,
    int cnt) throws IOException 
    Sends the buffer data to the client output, checking the state of Response and calling the right interceptors.
 public  void recycle() 
    Recycle the output buffer.
 public  void reset() 
 public  void setBufferSize(int size) 
 protected  void setConverter() throws IOException 
 public  void setEncoding(String s) 
 public  void setResponse(Response coyoteResponse) 
    Associated Coyote response.
 public  void setSuspended(boolean suspended) 
    Set the suspended flag.
 public  void write(int c) throws IOException 
 public  void write(char[] c) throws IOException 
 public  void write(String s) throws IOException 
 public  void write(byte[] b,
    int off,
    int len) throws IOException 
 public  void write(char[] c,
    int off,
    int len) throws IOException 
 public  void write(String s,
    int off,
    int len) throws IOException 
    Append a string to the buffer
 public  void writeByte(int b) throws IOException