Class HeaderParser


  • public class HeaderParser
    extends java.lang.Object

    The parser for the frame header of HTTP/2 frames.

    See Also:
    Parser
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getFrameType()  
      int getLength()  
      RateControl getRateControl()  
      int getStreamId()  
      boolean hasFlag​(int bit)  
      boolean parse​(java.nio.ByteBuffer buffer)
      Parses the header bytes in the given buffer; only the header bytes are consumed, therefore when this method returns, the buffer may contain unconsumed bytes.
      protected void reset()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • HeaderParser

        public HeaderParser​(RateControl rateControl)
    • Method Detail

      • reset

        protected void reset()
      • parse

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

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

        Parameters:
        buffer - the buffer to parse
        Returns:
        true if the whole header bytes were parsed, false if not enough header bytes were present in the buffer
      • getLength

        public int getLength()
      • getFrameType

        public int getFrameType()
      • hasFlag

        public boolean hasFlag​(int bit)
      • getStreamId

        public int getStreamId()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object