getByteLength method

int getByteLength()

Returns the total on-the-wire byte length of the full HTTP/3 frame (type varint + length varint + payload).

Implementation

int getByteLength() {
  final payload = serializePayload();
  final typeBytes = VarInt.encode(Http3FrameType.origin.value);
  final lengthBytes = VarInt.encode(payload.length);
  return typeBytes.length + lengthBytes.length + payload.length;
}