Package io.github.mahmoudimus.http2
Interface Frame
- All Known Implementing Classes:
Frame.Continuation,Frame.Data,Frame.GoAway,Frame.Headers,Frame.Ping,Frame.Priority,Frame.PushPromise,Frame.RstStream,Frame.Settings,Frame.Unknown,Frame.WindowUpdate
public sealed interface Frame
permits Frame.Data, Frame.Headers, Frame.Priority, Frame.RstStream, Frame.Settings, Frame.PushPromise, Frame.Ping, Frame.GoAway, Frame.WindowUpdate, Frame.Continuation, Frame.Unknown
One HTTP/2 frame (RFC 9113 §6). Instances are immutable apart from their byte arrays, which are
not copied: whoever creates a frame hands its arrays over.
The constructors check only what any frame of the type must satisfy (ranges, required stream
0 or non-0), throwing IllegalArgumentException; rules about what the peer is allowed to
send are checked by FrameReader and raised as Http2Exception.
padding on DATA, HEADERS and PUSH_PROMISE is the number of octets that padding adds to
the frame, counting the Pad Length octet: 0 means the PADDED flag is clear, and n > 0
means a Pad Length of n - 1. It counts toward flow control for DATA.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordCONTINUATION (§6.10).static final recordDATA (§6.1): part of a stream's content.static final recordGOAWAY (§6.8).static final recordHEADERS (§6.2).static final recordPING (§6.7).static final recordPRIORITY (§6.3): parsed and otherwise ignored.static final recordThe RFC 7540 priority signal carried by PRIORITY frames and HEADERS frames with the PRIORITY flag.static final recordPUSH_PROMISE (§6.6), with its complete field block.static final recordRST_STREAM (§6.4).static final recordSETTINGS (§6.5).static final recordA frame of a type this codec does not know (an extension).static final recordWINDOW_UPDATE (§6.9) for a stream, or for the connection whenstreamIdis 0. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe largest stream identifier, 2^31 - 1. -
Method Summary
Modifier and TypeMethodDescriptionintstreamId()The stream this frame belongs to, or 0 for the connection.inttype()The frame type code, one of theFrameTypeconstants (or any value forFrame.Unknown).
-
Field Details
-
MAX_STREAM_ID
static final int MAX_STREAM_IDThe largest stream identifier, 2^31 - 1.- See Also:
-
-
Method Details
-
streamId
int streamId()The stream this frame belongs to, or 0 for the connection.- Returns:
- the stream identifier, or 0 for the connection
-
type
int type()The frame type code, one of theFrameTypeconstants (or any value forFrame.Unknown).- Returns:
- the unsigned frame type code
-