Class FrameHeader

java.lang.Object
robaho.net.httpserver.http2.frame.FrameHeader

public class FrameHeader extends Object
Create a frame header object
  • Constructor Details

  • Method Details

    • getLength

      public int getLength()
      24-bit unsigned integer value that specifies length of the frame
    • getType

      public FrameType getType()
      defined as an enum FrameType, it identifies the type of the frame
    • getFlags

      public FrameFlag.FlagSet getFlags()
      defined as an EnumSet<FrameFlag>, it identifies flags associated with a particular frame
    • getStreamIdentifier

      public int getStreamIdentifier()
      31-bit unsigned integer uniquely identifies a frame
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • Parse

      public static FrameHeader Parse(byte[] tmpBuffer) throws Exception
      Parse the 9 bytes frame header to determine length, type, flags and the stream identifier
      Parameters:
      tmpBuffer - 9 bytes frame header
      Returns:
      Throws:
      Exception
    • debug

      public static String debug(byte[] header)
    • writeTo

      public void writeTo(OutputStream os) throws IOException
      Throws:
      IOException
    • writeTo

      public static void writeTo(OutputStream os, int length, FrameType frameType, FrameFlag.FlagSet flags, int streamId) throws IOException
      Throws:
      IOException
    • encode

      public static byte[] encode(int length, FrameType frameType, FrameFlag.FlagSet flags, int streamId)
    • encode

      public byte[] encode()
    • encode

      public byte[] encode(byte[] buffer)
      encode into an existing byte array