org.apache.hc.core5.http2.impl.nio

## Class FrameInputBuffer

- java.lang.Object
- - org.apache.hc.core5.http2.impl.nio.FrameInputBuffer

-     public final class FrameInputBuffer
      extends Object

  Frame input buffer for HTTP/2 non-blocking connections.
  Since:
    5.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FrameInputBuffer(BasicH2TransportMetrics metrics, int maxFramePayloadSize)`
    `FrameInputBuffer(int maxFramePayloadSize)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `H2TransportMetrics` | `getMetrics()`
    `void` | `put(ByteBuffer src)`
    `RawFrame` | `read(ByteBuffer src, ReadableByteChannel channel)` Attempts to read a complete frame from the given source buffer and the underlying data channel.
    `RawFrame` | `read(ReadableByteChannel channel)` Attempts to read a complete frame from the underlying data channel.
    `void` | `reset()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FrameInputBuffer

          public FrameInputBuffer(BasicH2TransportMetrics metrics,
                          int maxFramePayloadSize)

    - #### FrameInputBuffer

          public FrameInputBuffer(int maxFramePayloadSize)

  - ### Method Detail

    - #### put

          public void put(ByteBuffer src)

    - #### read

          public RawFrame read(ByteBuffer src,
                      ReadableByteChannel channel)
                        throws IOException

      Attempts to read a complete frame from the given source buffer and the underlying data channel. The source buffer is consumed first. More data can be read from the channel if required.
      Parameters:
        `src` - the source buffer or `null` if not available.
        `channel` - the underlying data channel.
      Returns:
        a complete frame or `null` a complete frame cannot be read.
      Throws:
        `IOException`
      Since:
        5.1

    - #### read

          public RawFrame read(ReadableByteChannel channel)
                        throws IOException

      Attempts to read a complete frame from the underlying data channel.
      Parameters:
        `channel` - the underlying data channel.
      Throws:
        `IOException`

    - #### reset

          public void reset()

    - #### getMetrics

          public H2TransportMetrics getMetrics()

Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.