Class FrameFlags

java.lang.Object
dev.relism.flash.http2.frame.FrameFlags

public final class FrameFlags extends Object
The frame-header flag bits (RFC 9113 §6), as bitwise constants plus predicate helpers.

The deliberate collision

Bit 0x1 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

    Fields
    Modifier and Type
    Field
    Description
    static final int
    SETTINGS/PING: this frame acknowledges the peer's own frame, rather than proposing new values.
    static final int
    HEADERS/PUSH_PROMISE/CONTINUATION: the header block is complete — no CONTINUATION follows.
    static final int
    DATA/HEADERS: no more frames will be sent for this stream in this direction.
    static final int
    DATA/HEADERS/PUSH_PROMISE: a pad-length byte and trailing padding are present — see Padding.
    static final int
    HEADERS: deprecated stream-dependency/weight fields are present (RFC 9113 §5.3.2 — parsed and discarded).
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    hasPriority(int flags)
     
    static boolean
    isAck(int flags)
     
    static boolean
    isEndHeaders(int flags)
     
    static boolean
    isEndStream(int flags)
     
    static boolean
    isPadded(int flags)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • END_STREAM

      public static final int END_STREAM
      DATA/HEADERS: no more frames will be sent for this stream in this direction.
      See Also:
    • ACK

      public static final int ACK
      SETTINGS/PING: this frame acknowledges the peer's own frame, rather than proposing new values.
      See Also:
    • END_HEADERS

      public static final int END_HEADERS
      HEADERS/PUSH_PROMISE/CONTINUATION: the header block is complete — no CONTINUATION follows.
      See Also:
    • PADDED

      public static final int PADDED
      DATA/HEADERS/PUSH_PROMISE: a pad-length byte and trailing padding are present — see Padding.
      See Also:
    • PRIORITY

      public static final int PRIORITY
      HEADERS: 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)