length static method
Requires data to be exactly expected bytes, throws BuError otherwise.
Implementation
static void length(
List<int> data,
int expected, {
required String operation,
required String name,
}) {
if (data.length != expected) {
throw CoreErrors.invalidOperationArguments(
operation,
name: name,
reason: 'expected $expected bytes, got ${data.length}',
details: {'expected': '$expected', 'actual': '${data.length}'},
);
}
}