Top Description Fields Constructors Methods
org.apache.coyote.http11.filters

public Class VoidOutputFilter

extends Object
implements OutputFilter
Class Inheritance
All Implemented Interfaces
org.apache.coyote.http11.OutputFilter, org.apache.coyote.http11.HttpOutputBuffer, org.apache.coyote.OutputBuffer
Imports
java.io.IOException, java.nio.ByteBuffer, org.apache.coyote.Response, org.apache.coyote.http11.HttpOutputBuffer, .OutputFilter

Void output filter, which silently swallows bytes written. Used with a 204 status (no content) or a HEAD request.
Author
Remy Maucherat

Field Summary

Modifier and TypeField and Description
private HttpOutputBuffer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
doWrite(ByteBuffer
data to write
chunk
)

Implements org.apache.coyote.OutputBuffer.doWrite.

Write the given data to the response.

public void
end()

Implements org.apache.coyote.http11.HttpOutputBuffer.end.

Finish writing the current response.

public void
flush()

Implements org.apache.coyote.http11.HttpOutputBuffer.flush.

Flushes any unwritten data to the client.

public long
getBytesWritten()

Implements org.apache.coyote.OutputBuffer.getBytesWritten.

Bytes written to the underlying socket.

public void
recycle()

Implements org.apache.coyote.http11.OutputFilter.recycle.

Make the filter ready to process the next request.

public void
setBuffer(HttpOutputBuffer
The next buffer instance
buffer
)

Implements org.apache.coyote.http11.OutputFilter.setBuffer.

Set the next buffer in the filter pipeline.

public void
setResponse(Response
The response to associate with this OutputFilter
response
)

Implements org.apache.coyote.http11.OutputFilter.setResponse.

Some filters need additional parameters from the response.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferback to summary
private HttpOutputBuffer buffer

Constructor Detail

VoidOutputFilterback to summary
public VoidOutputFilter()

Method Detail

doWriteback to summary
public int doWrite(ByteBuffer chunk) throws IOException

Implements org.apache.coyote.OutputBuffer.doWrite.

Doc from org.apache.coyote.OutputBuffer.doWrite.

Write the given data to the response. The caller owns the chunks.

Parameters
chunk:ByteBuffer

data to write

Returns:int

The number of bytes written which may be less than available in the input chunk

Annotations
@Override
Exceptions
IOException:
an underlying I/O error occurred
endback to summary
public void end() throws IOException

Implements org.apache.coyote.http11.HttpOutputBuffer.end.

Doc from org.apache.coyote.http11.HttpOutputBuffer.end.

Finish writing the current response. It is acceptable to write extra bytes using doWrite(java.nio.ByteBuffer) during the execution of this method.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs while writing to the client
flushback to summary
public void flush() throws IOException

Implements org.apache.coyote.http11.HttpOutputBuffer.flush.

Doc from org.apache.coyote.http11.HttpOutputBuffer.flush.

Flushes any unwritten data to the client.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs while flushing
getBytesWrittenback to summary
public long getBytesWritten()

Implements org.apache.coyote.OutputBuffer.getBytesWritten.

Doc from org.apache.coyote.OutputBuffer.getBytesWritten.

Bytes written to the underlying socket. This includes the effects of chunking, compression, etc.

Returns:long

Bytes written for the current request

Annotations
@Override
recycleback to summary
public void recycle()

Implements org.apache.coyote.http11.OutputFilter.recycle.

Doc from org.apache.coyote.http11.OutputFilter.recycle.

Make the filter ready to process the next request.

Annotations
@Override
setBufferback to summary
public void setBuffer(HttpOutputBuffer buffer)

Implements org.apache.coyote.http11.OutputFilter.setBuffer.

Doc from org.apache.coyote.http11.OutputFilter.setBuffer.

Set the next buffer in the filter pipeline.

Parameters
buffer:HttpOutputBuffer

The next buffer instance

Annotations
@Override
setResponseback to summary
public void setResponse(Response response)

Implements org.apache.coyote.http11.OutputFilter.setResponse.

Doc from org.apache.coyote.http11.OutputFilter.setResponse.

Some filters need additional parameters from the response. All the necessary reading can occur in that method, as this method is called after the response header processing is complete.

Parameters
response:Response

The response to associate with this OutputFilter

Annotations
@Override