Class Parser

  • Direct Known Subclasses:

    public class Parser
    extends java.lang.Object

    The HTTP/2 protocol parser.

    This parser makes use of the HeaderParser and of BodyParsers to parse HTTP/2 frames.

    • Method Detail

      • init

        public void init​(java.util.function.UnaryOperator<Parser.Listener> wrapper)
      • parse

        public void parse​(java.nio.ByteBuffer buffer)

        Parses the given buffer bytes and emit events to a Parser.Listener.

        When this method returns, the buffer may not be fully consumed, so invocations to this method should be wrapped in a loop:

         while (buffer.hasRemaining())
        buffer - the buffer to parse
      • parseHeader

        protected boolean parseHeader​(java.nio.ByteBuffer buffer)
      • parseBody

        protected boolean parseBody​(java.nio.ByteBuffer buffer)
      • getFrameType

        protected int getFrameType()
      • hasFlag

        protected boolean hasFlag​(int bit)
      • getMaxFrameLength

        public int getMaxFrameLength()
      • setMaxFrameLength

        public void setMaxFrameLength​(int maxFrameLength)
      • getMaxSettingsKeys

        public int getMaxSettingsKeys()
      • setMaxSettingsKeys

        public void setMaxSettingsKeys​(int maxSettingsKeys)
      • notifyConnectionFailure

        protected void notifyConnectionFailure​(int error,
                                               java.lang.String reason)