Top Description Methods
org.apache.coyote

public Interface InputBuffer

Known Direct Subinterfaces
org.apache.coyote.http11.InputFilter
Known Direct Implementers
org.apache.coyote.http2.Stream.StreamInputBuffer, org.apache.coyote.ajp.AjpProcessor.SocketInputBuffer, org.apache.coyote.http11.Http11InputBuffer, org.apache.coyote.http11.Http11InputBuffer.SocketInputBuffer
Imports
java.io.IOException, org.apache.tomcat.util.net.ApplicationBufferHandler

This class is only for internal use in the protocol implementation. All reading from Tomcat (or adapter) should be done using Request.doRead().

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

The number of bytes that can be read without blocking
available
()

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

public int

Returns:

The number of bytes that have been added to the buffer or -1 for end of stream
doRead
(ApplicationBufferHandler
ApplicationBufferHandler that provides the buffer to read data into.
handler
)

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

Method Detail

availableback to summary
public int 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

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

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

Exceptions
IOException:
If an I/O error occurs reading from the input stream