public class ChunkedOutputFilter extends java.lang.Object implements OutputFilter
Modifier and Type | Field and Description |
---|---|
protected OutputBuffer |
buffer
Next buffer in the pipeline.
|
protected java.nio.ByteBuffer |
chunkHeader
Chunk header.
|
protected java.nio.ByteBuffer |
crlfChunk |
protected java.nio.ByteBuffer |
endChunk
End chunk.
|
protected java.nio.ByteBuffer |
lastChunk |
Constructor and Description |
---|
ChunkedOutputFilter() |
Modifier and Type | Method and Description |
---|---|
int |
doWrite(java.nio.ByteBuffer chunk)
Write the given data to the response.
|
long |
end()
End the current request.
|
long |
getBytesWritten()
Bytes written to the underlying socket.
|
void |
recycle()
Make the filter ready to process the next request.
|
void |
setBuffer(OutputBuffer buffer)
Set the next buffer in the filter pipeline.
|
void |
setResponse(Response response)
Some filters need additional parameters from the response.
|
protected OutputBuffer buffer
protected final java.nio.ByteBuffer chunkHeader
protected final java.nio.ByteBuffer lastChunk
protected final java.nio.ByteBuffer crlfChunk
protected final java.nio.ByteBuffer endChunk
public int doWrite(java.nio.ByteBuffer chunk) throws java.io.IOException
OutputBuffer
doWrite
in interface OutputBuffer
chunk
- data to writejava.io.IOException
- an underlying I/O error occurredpublic long getBytesWritten()
OutputBuffer
getBytesWritten
in interface OutputBuffer
public void setResponse(Response response)
setResponse
in interface OutputFilter
response
- The response to associate with this OutputFilterpublic void setBuffer(OutputBuffer buffer)
setBuffer
in interface OutputFilter
buffer
- The next buffer instancepublic long end() throws java.io.IOException
end
in interface OutputFilter
java.io.IOException
- If an I/O error occurs while writing to the clientpublic void recycle()
recycle
in interface OutputFilter
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.