Package dev.relism.flash.http2.frame
Class FrameFlags
java.lang.Object
dev.relism.flash.http2.frame.FrameFlags
The frame-header flag bits (RFC 9113 §6), as bitwise constants plus predicate helpers.
The deliberate collision
Bit0x1 means different things on different frame types: END_STREAM on
DATA/HEADERS, ACK on SETTINGS/PING. They are the same
bit position because the RFC defines flags per-type, not globally — reusing the numeric value
is intentional on the wire, not a naming accident here. **Never call isEndStream(int) on a
SETTINGS/PING frame's flags, or isAck(int) on a DATA/HEADERS frame's** — each predicate is
named for the one frame type family it is valid to call it on; mixing them up silently
misreads an unrelated bit rather than throwing, because the bit pattern is, by construction,
identical.
RFC 9113 §4.1: flag bits not defined for a frame's type MUST be ignored on receipt and MUST NOT be set when sending. This class only ever tests bits it defines for the type the caller is working with; undefined bits are never inspected.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSETTINGS/PING: this frame acknowledges the peer's own frame, rather than proposing new values.static final intHEADERS/PUSH_PROMISE/CONTINUATION: the header block is complete — no CONTINUATION follows.static final intDATA/HEADERS: no more frames will be sent for this stream in this direction.static final intDATA/HEADERS/PUSH_PROMISE: a pad-length byte and trailing padding are present — seePadding.static final intHEADERS: deprecated stream-dependency/weight fields are present (RFC 9113 §5.3.2 — parsed and discarded). -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanhasPriority(int flags) static booleanisAck(int flags) static booleanisEndHeaders(int flags) static booleanisEndStream(int flags) static booleanisPadded(int flags)
-
Field Details
-
END_STREAM
public static final int END_STREAMDATA/HEADERS: no more frames will be sent for this stream in this direction.- See Also:
-
ACK
public static final int ACKSETTINGS/PING: this frame acknowledges the peer's own frame, rather than proposing new values.- See Also:
-
END_HEADERS
public static final int END_HEADERSHEADERS/PUSH_PROMISE/CONTINUATION: the header block is complete — no CONTINUATION follows.- See Also:
-
PADDED
public static final int PADDEDDATA/HEADERS/PUSH_PROMISE: a pad-length byte and trailing padding are present — seePadding.- See Also:
-
PRIORITY
public static final int PRIORITYHEADERS: deprecated stream-dependency/weight fields are present (RFC 9113 §5.3.2 — parsed and discarded).- See Also:
-
-
Method Details
-
isEndStream
public static boolean isEndStream(int flags) -
isAck
public static boolean isAck(int flags) -
isEndHeaders
public static boolean isEndHeaders(int flags) -
isPadded
public static boolean isPadded(int flags) -
hasPriority
public static boolean hasPriority(int flags)
-