org.apache.coyote.http11

Interface InputFilter

public interface InputFilter extends InputBuffer

Input filter interface.

Author: Remy Maucherat

Method Summary
intavailable()
Amount of bytes still available in a buffer.
intdoRead(ByteChunk chunk, Request unused)
Read bytes.
longend()
End the current request.
ByteChunkgetEncodingName()
Get the name of the encoding handled by this filter.
voidrecycle()
Make the filter ready to process the next request.
voidsetBuffer(InputBuffer buffer)
Set the next buffer in the filter pipeline.
voidsetRequest(Request request)
Some filters need additional parameters from the request.

Method Detail

available

public int available()
Amount of bytes still available in a buffer.

doRead

public int doRead(ByteChunk chunk, Request unused)
Read bytes.

Returns: Number of bytes read.

end

public long end()
End the current request.

Returns: 0 is the expected return value. A positive value indicates that too many bytes were read. This method is allowed to use buffer.doRead to consume extra bytes. The result of this method can't be negative (if an error happens, an IOException should be thrown instead).

getEncodingName

public ByteChunk getEncodingName()
Get the name of the encoding handled by this filter.

recycle

public void recycle()
Make the filter ready to process the next request.

setBuffer

public void setBuffer(InputBuffer buffer)
Set the next buffer in the filter pipeline.

setRequest

public void setRequest(Request request)
Some filters need additional parameters from the request. All the necessary reading can occur in that method, as this method is called after the request header processing is complete.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.