Top Description Inners Fields Constructors Methods
org.apache.hc.core5.http2.impl.nio

public final Class FrameInputBuffer

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.ByteBuffer, java.nio.channels.ReadableByteChannel, org.apache.hc.core5.http.ConnectionClosedException, org.apache.hc.core5.http2.H2ConnectionException, .H2CorruptFrameException, .H2Error, .H2TransportMetrics, org.apache.hc.core5.http2.frame.FrameConsts, .FrameFlag, .RawFrame, org.apache.hc.core5.http2.impl.BasicH2TransportMetrics, org.apache.hc.core5.util.Args

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum

Field Summary

Modifier and TypeField and Description
private final ByteBuffer
private final byte[]
private int
private final int
private final BasicH2TransportMetrics
private int
private FrameInputBuffer.State
private int
private int

Constructor Summary

AccessConstructor and Description
pack-priv
FrameInputBuffer(final BasicH2TransportMetrics metrics, final int bufferLen, final int maxFramePayloadSize)

public
FrameInputBuffer(final BasicH2TransportMetrics metrics, final int maxFramePayloadSize)

public
FrameInputBuffer(final int maxFramePayloadSize)

Method Summary

Modifier and TypeMethod and Description
public H2TransportMetrics
public void
public RawFrame

Returns:

a complete frame or null a complete frame cannot be read.
read
(final ByteBuffer
the source buffer or null if not available.
src
,
final ReadableByteChannel
the underlying data channel.
channel
)

Attempts to read a complete frame from the given source buffer and the underlying data channel.

public RawFrame
read(final ReadableByteChannel
the underlying data channel.
channel
)

Attempts to read a complete frame from the underlying data channel.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferback to summary
private final ByteBuffer buffer
bytesback to summary
private final byte[] bytes
flagsback to summary
private int flags
maxFramePayloadSizeback to summary
private final int maxFramePayloadSize
metricsback to summary
private final BasicH2TransportMetrics metrics
payloadLenback to summary
private int payloadLen
stateback to summary
private FrameInputBuffer.State state
streamIdback to summary
private int streamId
typeback to summary
private int type

Constructor Detail

FrameInputBufferback to summary
pack-priv FrameInputBuffer(final BasicH2TransportMetrics metrics, final int bufferLen, final int maxFramePayloadSize)
FrameInputBufferback to summary
public FrameInputBuffer(final BasicH2TransportMetrics metrics, final int maxFramePayloadSize)
FrameInputBufferback to summary
public FrameInputBuffer(final int maxFramePayloadSize)

Method Detail

getMetricsback to summary
public H2TransportMetrics getMetrics()
putback to summary
public void put(final ByteBuffer src)
Annotations
@Deprecated
readback to summary
public RawFrame read(final ByteBuffer src, final 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:ByteBuffer

the source buffer or null if not available.

channel:ReadableByteChannel

the underlying data channel.

Returns:RawFrame

a complete frame or null a complete frame cannot be read.

Since
5.1
readback to summary
public RawFrame read(final ReadableByteChannel channel) throws IOException

Attempts to read a complete frame from the underlying data channel.

Parameters
channel:ReadableByteChannel

the underlying data channel.

resetback to summary
public void reset()
org.apache.hc.core5.http2.impl.nio back to summary

pack-priv final Enum FrameInputBuffer.State

extends Enum<FrameInputBuffer.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final FrameInputBuffer.State
public static final FrameInputBuffer.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static FrameInputBuffer.State
public static FrameInputBuffer.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

HEAD_EXPECTEDback to summary
public static final FrameInputBuffer.State HEAD_EXPECTED
PAYLOAD_EXPECTEDback to summary
public static final FrameInputBuffer.State PAYLOAD_EXPECTED

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static FrameInputBuffer.State valueOf(String name)
valuesback to summary
public static FrameInputBuffer.State[] values()