vecU8 static method
vector bytes
Implementation
static CustomLayout vecU8(
{String? property, IntegerLayout? lengthSizeLayout}) {
lengthSizeLayout ??= (lengthSizeLayout?.clone(newProperty: "length") ??
u32(property: "length"));
final length = padding(lengthSizeLayout, propery: "length");
final layout = struct([
length,
blob(offset(length, -length.span), property: 'data'),
]);
return CustomLayout(
layout: layout,
encoder: (data) => {"data": data},
decoder: (data) => data["data"],
property: property,
);
}