serialize method
Implementation
@override
Uint8List serialize() {
final builder = BytesBuilder();
builder.addByte(frameType);
builder.add(VarInt.encode(streamId));
if (offset != null) {
builder.add(VarInt.encode(offset!));
}
if (hasExplicitLength) {
builder.add(VarInt.encode(data.length));
}
builder.add(data);
return Uint8List.fromList(builder.toBytes());
}