Class FrameUtil

java.lang.Object
org.omegazero.http.h2.util.FrameUtil

public final class FrameUtil extends Object
Contains utility methods for managing HTTP/2 frames.
Since:
1.2.1
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte[]
    int32BE(int value)
    Creates a new 4-byte array and writes the given value to it in network byte order.
    static int
    readInt16BE(byte[] data, int offset)
    Reads a 16-bit integer in network byte order (big endian) from the given data, starting at offset.
    static int
    readInt32BE(byte[] data, int offset)
    Reads a 32-bit integer in network byte order (big endian) from the given data, starting at offset.
    static void
    writeInt16BE(byte[] data, int offset, int value)
    Writes a 16-bit integer in network byte order (big endian) to the given data, starting at offset.
    static void
    writeInt32BE(byte[] data, int offset, int value)
    Writes a 32-bit integer in network byte order (big endian) to the given data, starting at offset.

    Methods inherited from class java.lang.Object

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

    • readInt16BE

      public static int readInt16BE(byte[] data, int offset)
      Reads a 16-bit integer in network byte order (big endian) from the given data, starting at offset.
      Parameters:
      data - The data
      offset - The offset of the integer
      Returns:
      The 16-bit integer
      See Also:
    • writeInt16BE

      public static void writeInt16BE(byte[] data, int offset, int value)
      Writes a 16-bit integer in network byte order (big endian) to the given data, starting at offset.
      Parameters:
      data - The data to write to
      offset - The offset of the integer
      value - The value to write
      See Also:
    • readInt32BE

      public static int readInt32BE(byte[] data, int offset)
      Reads a 32-bit integer in network byte order (big endian) from the given data, starting at offset.
      Parameters:
      data - The data
      offset - The offset of the integer
      Returns:
      The 32-bit integer
      See Also:
    • writeInt32BE

      public static void writeInt32BE(byte[] data, int offset, int value)
      Writes a 32-bit integer in network byte order (big endian) to the given data, starting at offset.
      Parameters:
      data - The data to write to
      offset - The offset of the integer
      value - The value to write
      See Also:
    • int32BE

      public static byte[] int32BE(int value)
      Creates a new 4-byte array and writes the given value to it in network byte order.
      Parameters:
      value - The value to store in the new array
      Returns:
      The array containing the value