Top Description Fields Constructors Methods
org.apache.coyote.http11.filters

public Class VoidInputFilter

extends Object
implements InputFilter
Class Inheritance
All Implemented Interfaces
org.apache.coyote.http11.InputFilter, org.apache.coyote.InputBuffer
Imports
java.io.IOException, java.nio.charset.StandardCharsets, org.apache.coyote.InputBuffer, .Request, org.apache.coyote.http11.InputFilter, org.apache.tomcat.util.buf.ByteChunk, org.apache.tomcat.util.net.ApplicationBufferHandler

Void input filter, which returns -1 when attempting a read. Used with a GET, HEAD, or a similar request.
Author
Remy Maucherat

Field Summary

Modifier and TypeField and Description
protected static final ByteChunk
protected static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
available()

Implements org.apache.coyote.InputBuffer.available.

Obtain an estimate of the number of bytes that can be read without blocking.

public int
doRead(ApplicationBufferHandler
ApplicationBufferHandler that provides the buffer to read data into.
handler
)

Implements org.apache.coyote.InputBuffer.doRead.

Read from the input stream into the ByteBuffer provided by the ApplicationBufferHandler.

public long

Returns:

Should return 0 unless the filter does some content length delimitation, in which case the number is the amount of extra bytes or missing bytes, which would indicate an error.

Note

It is recommended that extra bytes be swallowed by the filter.

end
()

Implements org.apache.coyote.http11.InputFilter.end.

End the current request.

public ByteChunk
getEncodingName()

Implements org.apache.coyote.http11.InputFilter.getEncodingName.

Return the name of the associated encoding; Here, the value is "void".

public boolean
isFinished()

Implements org.apache.coyote.http11.InputFilter.isFinished.

Has the request body been read fully?

public void
recycle()

Implements org.apache.coyote.http11.InputFilter.recycle.

Make the filter ready to process the next request.

public void
setBuffer(InputBuffer
The next buffer
buffer
)

Implements org.apache.coyote.http11.InputFilter.setBuffer.

Set the next buffer in the filter pipeline.

public void
setRequest(Request
The request to be associated with this filter
request
)

Implements org.apache.coyote.http11.InputFilter.setRequest.

Set the associated request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ENCODINGback to summary
protected static final ByteChunk ENCODING
ENCODING_NAMEback to summary
protected static final String ENCODING_NAME

Constructor Detail

VoidInputFilterback to summary
public VoidInputFilter()

Method Detail

availableback to summary
public int available()

Implements org.apache.coyote.InputBuffer.available.

Doc from org.apache.coyote.InputBuffer.available.

Obtain an estimate of the number of bytes that can be read without blocking. Typically, this will be the number of available bytes known to be buffered.

Returns:int

The number of bytes that can be read without blocking

Annotations
@Override
doReadback to summary
public int doRead(ApplicationBufferHandler handler) throws IOException

Implements org.apache.coyote.InputBuffer.doRead.

Doc from org.apache.coyote.InputBuffer.doRead.

Read from the input stream into the ByteBuffer provided by the ApplicationBufferHandler.

Important Note

the current model assumes that the protocol will 'own' the ByteBuffer and return a pointer to it.

Parameters
handler:ApplicationBufferHandler

ApplicationBufferHandler that provides the buffer to read data into.

Returns:int

The number of bytes that have been added to the buffer or -1 for end of stream

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs reading from the input stream
endback to summary
public long end() throws IOException

Implements org.apache.coyote.http11.InputFilter.end.

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

Returns:long

Should return 0 unless the filter does some content length delimitation, in which case the number is the amount of extra bytes or missing bytes, which would indicate an error.

Note

It is recommended that extra bytes be swallowed by the filter.

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.coyote.http11.InputFilter.end.

If an error happens

getEncodingNameback to summary
public ByteChunk getEncodingName()

Implements org.apache.coyote.http11.InputFilter.getEncodingName.

Return the name of the associated encoding; Here, the value is "void".

Returns:ByteChunk

Doc from org.apache.coyote.http11.InputFilter.getEncodingName.

The encoding name as a byte chunk to facilitate comparison with the value read from the HTTP headers which will also be a ByteChunk

Annotations
@Override
isFinishedback to summary
public boolean isFinished()

Implements org.apache.coyote.http11.InputFilter.isFinished.

Doc from org.apache.coyote.http11.InputFilter.isFinished.

Has the request body been read fully?

Returns:boolean

true if the request body has been fully read, otherwise false

Annotations
@Override
recycleback to summary
public void recycle()

Implements org.apache.coyote.http11.InputFilter.recycle.

Make the filter ready to process the next request.

Annotations
@Override
setBufferback to summary
public void setBuffer(InputBuffer buffer)

Implements org.apache.coyote.http11.InputFilter.setBuffer.

Set the next buffer in the filter pipeline.

Parameters
buffer:InputBuffer

Doc from org.apache.coyote.http11.InputFilter.setBuffer.

The next buffer

Annotations
@Override
setRequestback to summary
public void setRequest(Request request)

Implements org.apache.coyote.http11.InputFilter.setRequest.

Set the associated request.

Parameters
request:Request

Doc from org.apache.coyote.http11.InputFilter.setRequest.

The request to be associated with this filter

Annotations
@Override