Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » coyote » http11 » [javadoc | source]
org.apache.coyote.http11
public class: InternalOutputBuffer [javadoc | source]
java.lang.Object
   org.apache.coyote.http11.InternalOutputBuffer

All Implemented Interfaces:
    ByteOutputChannel, OutputBuffer

Output buffer.
Nested Class Summary:
protected class  InternalOutputBuffer.OutputStreamOutputBuffer  This class is an output buffer which will write data to an output stream. 
Field Summary
protected static  StringManager sm    The string manager for this package. 
protected  Response response    Associated Coyote response. 
protected  MimeHeaders headers    Headers of the associated request. 
protected  boolean committed    Committed flag. 
protected  boolean finished    Finished flag. 
protected  byte[] buf    The buffer used for header composition. 
protected  int pos    Position in the buffer. 
protected  OutputStream outputStream    Underlying output stream. 
protected  OutputBuffer outputStreamOutputBuffer    Underlying output buffer. 
protected  OutputFilter[] filterLibrary    Filter library. Note: Filter[0] is always the "chunked" filter. 
protected  OutputFilter[] activeFilters    Active filter (which is actually the top of the pipeline). 
protected  int lastActiveFilter    Index of the last active filter. 
protected  ByteChunk socketBuffer    Socket buffer. 
protected  boolean useSocketBuffer    Socket buffer (extra buffering to reduce number of packets sent). 
Constructor:
 public InternalOutputBuffer(Response response) 
    Default constructor.
 public InternalOutputBuffer(Response response,
    int headerBufferSize) 
    Alternate constructor.
Method from org.apache.coyote.http11.InternalOutputBuffer Summary:
addActiveFilter,   addFilter,   clearFilters,   commit,   doWrite,   endHeaders,   endRequest,   flush,   getFilters,   getOutputStream,   nextRequest,   realWriteBytes,   recycle,   reset,   sendAck,   sendHeader,   sendHeader,   sendHeader,   sendStatus,   setOutputStream,   setSocketBuffer,   write,   write,   write,   write,   write,   write
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.coyote.http11.InternalOutputBuffer Detail:
 public  void addActiveFilter(OutputFilter filter) 
    Add an output filter to the filter library.
 public  void addFilter(OutputFilter filter) 
    Add an output filter to the filter library.
 public  void clearFilters() 
    Clear filters.
 protected  void commit() throws IOException 
    Commit the response.
 public int doWrite(ByteChunk chunk,
    Response res) throws IOException 
    Write the contents of a byte chunk.
 public  void endHeaders() 
    End the header block.
 public  void endRequest() throws IOException 
    End request.
 public  void flush() throws IOException 
    Flush the response.
 public OutputFilter[] getFilters() 
    Get filters.
 public OutputStream getOutputStream() 
    Get the underlying socket output stream.
 public  void nextRequest() 
    End processing of current HTTP request. Note: All bytes of the current request should have been already consumed. This method only resets all the pointers so that we are ready to parse the next HTTP request.
 public  void realWriteBytes(byte[] cbuf,
    int off,
    int len) throws IOException 
    Callback to write data from the buffer.
 public  void recycle() 
    Recycle the output buffer. This should be called when closing the connection.
 public  void reset() 
    Reset current response.
 public  void sendAck() throws IOException 
    Send an acknoledgement.
 public  void sendHeader(MessageBytes name,
    MessageBytes value) 
    Send a header.
 public  void sendHeader(ByteChunk name,
    ByteChunk value) 
    Send a header.
 public  void sendHeader(String name,
    String value) 
    Send a header.
 public  void sendStatus() 
    Send the response status line.
 public  void setOutputStream(OutputStream outputStream) 
    Set the underlying socket output stream.
 public  void setSocketBuffer(int socketBufferSize) 
    Set the socket buffer size.
 protected  void write(MessageBytes mb) 
    This method will write the contents of the specyfied message bytes buffer to the output stream, without filtering. This method is meant to be used to write the response header.
 protected  void write(ByteChunk bc) 
    This method will write the contents of the specyfied message bytes buffer to the output stream, without filtering. This method is meant to be used to write the response header.
 protected  void write(CharChunk cc) 
    This method will write the contents of the specyfied char buffer to the output stream, without filtering. This method is meant to be used to write the response header.
 public  void write(byte[] b) 
    This method will write the contents of the specyfied byte buffer to the output stream, without filtering. This method is meant to be used to write the response header.
 protected  void write(String s) 
    This method will write the contents of the specyfied String to the output stream, without filtering. This method is meant to be used to write the response header.
 protected  void write(int i) 
    This method will print the specified integer to the output stream, without filtering. This method is meant to be used to write the response header.