Class FrameInputBuffer
- java.lang.Object
-
- org.apache.hc.core5.http2.impl.nio.FrameInputBuffer
-
public final class FrameInputBuffer extends java.lang.Object
Frame input buffer for HTTP/2 non-blocking connections.- Since:
- 5.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
FrameInputBuffer.State
-
Field Summary
Fields Modifier and Type Field Description private java.nio.ByteBuffer
buffer
private byte[]
bytes
private int
flags
private int
maxFramePayloadSize
private BasicH2TransportMetrics
metrics
private int
payloadLen
private FrameInputBuffer.State
state
private int
streamId
private int
type
-
Constructor Summary
Constructors Constructor Description FrameInputBuffer(int maxFramePayloadSize)
FrameInputBuffer(BasicH2TransportMetrics metrics, int maxFramePayloadSize)
FrameInputBuffer(BasicH2TransportMetrics metrics, int bufferLen, int maxFramePayloadSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description H2TransportMetrics
getMetrics()
void
put(java.nio.ByteBuffer src)
Deprecated.RawFrame
read(java.nio.ByteBuffer src, java.nio.channels.ReadableByteChannel channel)
Attempts to read a complete frame from the given source buffer and the underlying data channel.RawFrame
read(java.nio.channels.ReadableByteChannel channel)
Attempts to read a complete frame from the underlying data channel.void
reset()
-
-
-
Field Detail
-
metrics
private final BasicH2TransportMetrics metrics
-
maxFramePayloadSize
private final int maxFramePayloadSize
-
bytes
private final byte[] bytes
-
buffer
private final java.nio.ByteBuffer buffer
-
state
private FrameInputBuffer.State state
-
payloadLen
private int payloadLen
-
type
private int type
-
flags
private int flags
-
streamId
private int streamId
-
-
Constructor Detail
-
FrameInputBuffer
FrameInputBuffer(BasicH2TransportMetrics metrics, int bufferLen, int maxFramePayloadSize)
-
FrameInputBuffer
public FrameInputBuffer(BasicH2TransportMetrics metrics, int maxFramePayloadSize)
-
FrameInputBuffer
public FrameInputBuffer(int maxFramePayloadSize)
-
-
Method Detail
-
put
@Deprecated public void put(java.nio.ByteBuffer src)
Deprecated.
-
read
public RawFrame read(java.nio.ByteBuffer src, java.nio.channels.ReadableByteChannel channel) throws java.io.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 ornull
if not available.channel
- the underlying data channel.- Returns:
- a complete frame or
null
a complete frame cannot be read. - Throws:
java.io.IOException
- Since:
- 5.1
-
read
public RawFrame read(java.nio.channels.ReadableByteChannel channel) throws java.io.IOException
Attempts to read a complete frame from the underlying data channel.- Parameters:
channel
- the underlying data channel.- Throws:
java.io.IOException
-
reset
public void reset()
-
getMetrics
public H2TransportMetrics getMetrics()
-
-