InputFilter, InputBuffer, ApplicationBufferHandlerpublic class IdentityInputFilter extends java.lang.Object implements InputFilter, ApplicationBufferHandler
| Modifier and Type | Field | Description |
|---|---|---|
protected InputBuffer |
buffer |
Next buffer in the pipeline.
|
protected long |
contentLength |
Content length.
|
protected static ByteChunk |
ENCODING |
|
protected static java.lang.String |
ENCODING_NAME |
|
protected long |
remaining |
Remaining bytes.
|
protected java.nio.ByteBuffer |
tempRead |
ByteBuffer used to read leftover bytes.
|
| Constructor | Description |
|---|---|
IdentityInputFilter(int maxSwallowSize) |
| Modifier and Type | Method | Description |
|---|---|---|
int |
available() |
Amount of bytes still available in a buffer.
|
int |
doRead(ApplicationBufferHandler handler) |
Read from the input stream into the ByteBuffer provided by the
ApplicationBufferHandler.
|
long |
end() |
End the current request.
|
void |
expand(int size) |
|
java.nio.ByteBuffer |
getByteBuffer() |
|
ByteChunk |
getEncodingName() |
Return the name of the associated encoding; Here, the value is
"identity".
|
boolean |
isFinished() |
Has the request body been read fully?
|
void |
recycle() |
Make the filter ready to process the next request.
|
void |
setBuffer(InputBuffer buffer) |
Set the next buffer in the filter pipeline.
|
void |
setByteBuffer(java.nio.ByteBuffer buffer) |
|
void |
setRequest(Request request) |
Read the content length from the request.
|
protected static final java.lang.String ENCODING_NAME
protected static final ByteChunk ENCODING
protected long contentLength
protected long remaining
protected InputBuffer buffer
protected java.nio.ByteBuffer tempRead
public int doRead(ApplicationBufferHandler handler) throws java.io.IOException
InputBufferdoRead in interface InputBufferhandler - ApplicationBufferHandler that provides the buffer to read
data into.java.io.IOException - If an I/O error occurs reading from the input streampublic void setRequest(Request request)
setRequest in interface InputFilterrequest - The request to be associated with this filterpublic long end()
throws java.io.IOException
InputFilterend in interface InputFilterjava.io.IOException - If an error happenspublic int available()
available in interface InputFilterpublic void setBuffer(InputBuffer buffer)
setBuffer in interface InputFilterbuffer - The next bufferpublic void recycle()
recycle in interface InputFilterpublic ByteChunk getEncodingName()
getEncodingName in interface InputFilterpublic boolean isFinished()
InputFilterisFinished in interface InputFiltertrue if the request body has been fully read, otherwise
falsepublic void setByteBuffer(java.nio.ByteBuffer buffer)
setByteBuffer in interface ApplicationBufferHandlerpublic java.nio.ByteBuffer getByteBuffer()
getByteBuffer in interface ApplicationBufferHandlerpublic void expand(int size)
expand in interface ApplicationBufferHandlerCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.