Class BodyParser

Direct Known Subclasses:
ContinuationBodyParser, DataBodyParser, GoAwayBodyParser, HeadersBodyParser, PingBodyParser, PriorityBodyParser, PushPromiseBodyParser, ResetBodyParser, SettingsBodyParser, UnknownBodyParser, WindowUpdateBodyParser

public abstract class BodyParser extends Object

The base parser for the frame body of HTTP/2 frames.

Subclasses implement parse(ByteBuffer) to parse the frame specific body.

See Also:
  • Constructor Details

  • Method Details

    • parse

      public abstract boolean parse(ByteBuffer buffer)

      Parses the body bytes in the given buffer; only the body bytes are consumed, therefore when this method returns, the buffer may contain unconsumed bytes.

      buffer - the buffer to parse
      true if the whole body bytes were parsed, false if not enough body bytes were present in the buffer
    • emptyBody

      protected void emptyBody(ByteBuffer buffer)
    • hasFlag

      protected boolean hasFlag(int bit)
    • isPadding

      protected boolean isPadding()
    • isEndStream

      protected boolean isEndStream()
    • getStreamId

      protected int getStreamId()
    • getBodyLength

      protected int getBodyLength()
    • getFrameType

      protected int getFrameType()
    • notifyData

      protected void notifyData(DataFrame frame)
    • notifyHeaders

      protected void notifyHeaders(HeadersFrame frame)
    • notifyPriority

      protected void notifyPriority(PriorityFrame frame)
    • notifyReset

      protected void notifyReset(ResetFrame frame)
    • notifySettings

      protected void notifySettings(SettingsFrame frame)
    • notifyPushPromise

      protected void notifyPushPromise(PushPromiseFrame frame)
    • notifyPing

      protected void notifyPing(PingFrame frame)
    • notifyGoAway

      protected void notifyGoAway(GoAwayFrame frame)
    • notifyWindowUpdate

      protected void notifyWindowUpdate(WindowUpdateFrame frame)
    • connectionFailure

      protected boolean connectionFailure(ByteBuffer buffer, int error, String reason)
    • streamFailure

      protected boolean streamFailure(int streamId, int error, String reason)
    • rateControlOnEvent

      protected boolean rateControlOnEvent(Object o)