VoidOutputFilter.javaAPI DocApache Tomcat 6.0.143598Fri Jul 20 04:20:34 BST 2007org.apache.coyote.http11.filters


public class VoidOutputFilter extends Object implements org.apache.coyote.http11.OutputFilter
Void output filter, which silently swallows bytes written. Used with a 204 status (no content) or a HEAD request.
Remy Maucherat

Fields Summary
protected static final String
protected static final org.apache.tomcat.util.buf.ByteChunk
protected org.apache.coyote.OutputBuffer
Next buffer in the pipeline.
Constructors Summary
Methods Summary
public intdoWrite(org.apache.tomcat.util.buf.ByteChunk chunk, org.apache.coyote.Response res)
Write some bytes.

number of bytes written by the filter

        return chunk.getLength();

public longend()
End the current request. It is acceptable to write extra bytes using buffer.doWrite during the execution of this method.

Should return 0 unless the filter does some content length delimitation, in which case the number is the amount of extra bytes or missing bytes, which would indicate an error. Note: It is recommended that extra bytes be swallowed by the filter.

        return 0;
public org.apache.tomcat.util.buf.ByteChunkgetEncodingName()
Return the name of the associated encoding; Here, the value is "identity".

        return ENCODING;
public voidrecycle()
Make the filter ready to process the next request.

public voidsetBuffer(org.apache.coyote.OutputBuffer buffer)
Set the next buffer in the filter pipeline.

        this.buffer = buffer;
public voidsetResponse(org.apache.coyote.Response response)
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.