org.apache.coyote

## Interface InputBuffer

- All Known Subinterfaces:
    InputFilter
  All Known Implementing Classes:
    AbstractAjpProcessor.SocketInputBuffer, AbstractInputBuffer, BufferedInputFilter, ChunkedInputFilter, IdentityInputFilter, InternalAprInputBuffer, InternalAprInputBuffer.SocketInputBuffer, InternalInputBuffer, InternalInputBuffer.InputStreamInputBuffer, InternalNioInputBuffer, InternalNioInputBuffer.SocketInputBuffer, SavedRequestInputFilter, VoidInputFilter

      public interface InputBuffer

  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

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `available()` Obtain an estimate of the number of bytes that can be read without blocking.
    `int` | `doRead(ByteChunk chunk, Request request)` Read from the input stream into the given buffer.

- - ### Method Detail

    - #### doRead

          int doRead(ByteChunk chunk,
                   Request request)
                     throws java.io.IOException

      Read from the input stream into the given buffer. IMPORTANT: the current model assumes that the protocol will 'own' the buffer and return a pointer to it in ByteChunk (i.e. the param will have chunk.getBytes()==null before call, and the result after the call).
      Parameters:
        `chunk` - The buffer to read data into.
        `request` - The associated request
      Returns:
        The number of bytes that have been added to the buffer or -1 for end of stream
      Throws:
        `java.io.IOException` - If an I/O error occurs reading from the input stream

    - #### available

          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:
        The number of bytes that can be read without blocking

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.