Package org.omegazero.http.h2.util
Class FrameUtil
java.lang.Object
org.omegazero.http.h2.util.FrameUtil
Contains utility methods for managing HTTP/2 frames.
- Since:
- 1.2.1
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
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 dataoffset
- 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 tooffset
- The offset of the integervalue
- 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 dataoffset
- 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 tooffset
- The offset of the integervalue
- 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
-