decode method
Implementation
(List<T>, int) decode(int offset, Uint8List data) {
final length = switch (fixed_length) {
int length => length,
_ => () {
final length = FunctionParamInt()
.decode(data.sublist(offset, offset + size_unit));
offset += size_unit;
return length.toInt();
}.call(),
};
final values = <T>[];
final array_offset = offset;
int max_offset = 0;
for (var i = 0; i < length.toInt(); i++) {
final decoded = decodeParameter(
data: data,
type: itemType,
offset: offset,
max_offset: max_offset,
header_offset_increment: array_offset,
);
offset = decoded.offset;
max_offset = max(max_offset, decoded.max_offset);
values.add(decoded.value);
}
max_offset = max(max_offset, offset);
return (values, max_offset);
}