public class IdentityInputFilter extends Object implements InputFilter, ApplicationBufferHandler
Modifier and Type | Field and Description |
---|---|
protected InputBuffer |
buffer
Next buffer in the pipeline.
|
protected long |
contentLength
Content length.
|
protected static ByteChunk |
ENCODING |
protected static String |
ENCODING_NAME |
protected long |
remaining
Remaining bytes.
|
protected ByteBuffer |
tempRead
ByteBuffer used to read leftover bytes.
|
Constructor and Description |
---|
IdentityInputFilter(int maxSwallowSize) |
Modifier and Type | Method and 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.
|
int |
doRead(ByteChunk chunk)
Deprecated.
Unused. Will be removed in Tomcat 9. Use
doRead(ApplicationBufferHandler) |
long |
end()
End the current request.
|
void |
expand(int size) |
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(ByteBuffer buffer) |
void |
setRequest(Request request)
Read the content length from the request.
|
protected static final String ENCODING_NAME
protected static final ByteChunk ENCODING
protected long contentLength
protected long remaining
protected InputBuffer buffer
protected ByteBuffer tempRead
@Deprecated public int doRead(ByteChunk chunk) throws IOException
doRead(ApplicationBufferHandler)
InputBuffer
doRead
in interface InputBuffer
chunk
- The buffer to read data into.IOException
- If an I/O error occurs reading from the input streampublic int doRead(ApplicationBufferHandler handler) throws IOException
InputBuffer
doRead
in interface InputBuffer
handler
- ApplicationBufferHandler that provides the buffer to read
data into.IOException
- If an I/O error occurs reading from the input streampublic void setRequest(Request request)
setRequest
in interface InputFilter
request
- The request to be associated with this filterpublic long end() throws IOException
InputFilter
end
in interface InputFilter
IOException
- If an error happenspublic int available()
available
in interface InputBuffer
public void setBuffer(InputBuffer buffer)
setBuffer
in interface InputFilter
buffer
- The next bufferpublic void recycle()
recycle
in interface InputFilter
public ByteChunk getEncodingName()
getEncodingName
in interface InputFilter
public boolean isFinished()
InputFilter
isFinished
in interface InputFilter
true
if the request body has been fully read, otherwise
false
public void setByteBuffer(ByteBuffer buffer)
setByteBuffer
in interface ApplicationBufferHandler
public ByteBuffer getByteBuffer()
getByteBuffer
in interface ApplicationBufferHandler
public void expand(int size)
expand
in interface ApplicationBufferHandler
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.