org.apache.coyote.http11.filters

Class ChunkedOutputFilter

public class ChunkedOutputFilter extends Object implements OutputFilter

Chunked output filter.

Author: Remy Maucherat

Field Summary
protected OutputBufferbuffer
Next buffer in the pipeline.
protected ByteChunkchunkHeader
Chunk header.
protected byte[]chunkLength
Buffer used for chunk length conversion.
protected static ByteChunkENCODING
protected static StringENCODING_NAME
protected static ByteChunkEND_CHUNK
End chunk.
Constructor Summary
ChunkedOutputFilter()
Default constructor.
Method Summary
intdoWrite(ByteChunk chunk, Response res)
Write some bytes.
longend()
End the current request.
ByteChunkgetEncodingName()
Return the name of the associated encoding; Here, the value is "identity".
voidrecycle()
Make the filter ready to process the next request.
voidsetBuffer(OutputBuffer buffer)
Set the next buffer in the filter pipeline.
voidsetResponse(Response response)
Some filters need additional parameters from the response.

Field Detail

buffer

protected OutputBuffer buffer
Next buffer in the pipeline.

chunkHeader

protected ByteChunk chunkHeader
Chunk header.

chunkLength

protected byte[] chunkLength
Buffer used for chunk length conversion.

ENCODING

protected static final ByteChunk ENCODING

ENCODING_NAME

protected static final String ENCODING_NAME

END_CHUNK

protected static final ByteChunk END_CHUNK
End chunk.

Constructor Detail

ChunkedOutputFilter

public ChunkedOutputFilter()
Default constructor.

Method Detail

doWrite

public int doWrite(ByteChunk chunk, Response res)
Write some bytes.

Returns: number of bytes written by the filter

end

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

getEncodingName

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

recycle

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

setBuffer

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

setResponse

public void setResponse(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.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.