public class BufferedInputFilter extends Object implements InputFilter, ApplicationBufferHandler
Constructor and Description |
---|
BufferedInputFilter() |
Modifier and Type | Method and Description |
---|---|
int |
available()
Obtain an estimate of the number of bytes that can be read without
blocking.
|
int |
doRead(ApplicationBufferHandler handler)
Fills the given ByteBuffer with the buffered request body.
|
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()
Get the name of the encoding handled by this filter.
|
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 |
setLimit(int limit)
Set the buffering limit.
|
void |
setRequest(Request request)
Reads the request body and buffers it.
|
public void setLimit(int limit)
limit
- The maximum number of bytes that will be bufferedpublic void setRequest(Request request)
setRequest
in interface InputFilter
request
- The request to be associated with this filter@Deprecated public int doRead(ByteChunk chunk) throws IOException
doRead(ApplicationBufferHandler)
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
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 setBuffer(InputBuffer buffer)
InputFilter
setBuffer
in interface InputFilter
buffer
- The next bufferpublic void recycle()
InputFilter
recycle
in interface InputFilter
public ByteChunk getEncodingName()
InputFilter
getEncodingName
in interface InputFilter
public long end() throws IOException
InputFilter
end
in interface InputFilter
IOException
- If an error happenspublic int available()
InputBuffer
available
in interface InputBuffer
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.