FileDocCategorySizeDatePackage
VoidOutputFilter.javaAPI DocGlassfish v2 API4653Fri May 04 22:32:42 BST 2007org.apache.coyote.http11.filters

VoidOutputFilter

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.
author
Remy Maucherat

Fields Summary
protected static final String
ENCODING_NAME
protected static final org.apache.tomcat.util.buf.ByteChunk
ENCODING
protected org.apache.coyote.OutputBuffer
buffer
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.

return
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.

return
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.