OutputBuffer (Apache Tomcat 7.0.104 API Documentation)

org.apache.coyote

## Interface OutputBuffer

- All Known Subinterfaces:
    OutputFilter
  All Known Implementing Classes:
    AbstractAjpProcessor.SocketOutputBuffer, AbstractOutputBuffer, ChunkedOutputFilter, GzipOutputFilter, IdentityOutputFilter, InternalAprOutputBuffer, InternalAprOutputBuffer.SocketOutputBuffer, InternalNioOutputBuffer, InternalNioOutputBuffer.SocketOutputBuffer, InternalOutputBuffer, InternalOutputBuffer.OutputStreamOutputBuffer, VoidOutputFilter

      public interface OutputBuffer

  Output buffer. This class is used internally by the protocol implementation. All writes from higher level code should happen via Response.doWrite().
  Author:
    Remy Maucherat

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `doWrite(ByteChunk chunk, Response response)` Write the given data to the response.
    `long` | `getBytesWritten()` Bytes written to the underlying socket.

- - ### Method Detail

    - #### doWrite

          int doWrite(ByteChunk chunk,
                    Response response)
                      throws IOException

      Write the given data to the response. The caller owns the chunks.
      Parameters:
        `chunk` - data to write
        `response` - The response to which the data should be written. (Should be the response already associated with the OutputBuffer).
      Returns:
        The number of bytes written which may be less than available in the input chunk
      Throws:
        `IOException` - an underlying I/O error occurred

    - #### getBytesWritten

          long getBytesWritten()

      Bytes written to the underlying socket. This includes the effects of chunking, compression, etc.
      Returns:
        Bytes written for the current request

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.