org.apache.coyote.http11.filters

Class IdentityInputFilter

public class IdentityInputFilter extends Object implements InputFilter

Identity input filter.

Author: Remy Maucherat

Field Summary
protected InputBufferbuffer
Next buffer in the pipeline.
protected longcontentLength
Content length.
protected ByteChunkendChunk
Chunk used to read leftover bytes.
protected static ByteChunkENCODING
protected static StringENCODING_NAME
protected longremaining
Remaining bytes.
Method Summary
intavailable()
Amount of bytes still available in a buffer.
intdoRead(ByteChunk chunk, Request req)
Read bytes.
longend()
End the current request.
longgetContentLength()
Get content length.
ByteChunkgetEncodingName()
Return the name of the associated encoding; Here, the value is "identity".
longgetRemaining()
Get remaining bytes.
voidrecycle()
Make the filter ready to process the next request.
voidsetBuffer(InputBuffer buffer)
Set the next buffer in the filter pipeline.
voidsetRequest(Request request)
Read the content length from the request.

Field Detail

buffer

protected InputBuffer buffer
Next buffer in the pipeline.

contentLength

protected long contentLength
Content length.

endChunk

protected ByteChunk endChunk
Chunk used to read leftover bytes.

ENCODING

protected static final ByteChunk ENCODING

ENCODING_NAME

protected static final String ENCODING_NAME

remaining

protected long remaining
Remaining bytes.

Method Detail

available

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

doRead

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

Returns: If the filter does request length control, this value is significant; it should be the number of bytes consumed from the buffer, up until the end of the current request body, or the buffer length, whichever is greater. If the filter does not do request body length control, the returned value should be -1.

end

public long end()
End the current request.

getContentLength

public long getContentLength()
Get content length.

getEncodingName

public ByteChunk getEncodingName()
Return the name of the associated encoding; Here, the value is "identity".

getRemaining

public long getRemaining()
Get remaining bytes.

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)
Read the content length from the request.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.