prependVarint static method

List<int> prependVarint(
  1. List<int> data
)

Prepends a variable-length integer encoding of the given data length to the provided data.

Implementation

static List<int> prependVarint(List<int> data) {
  final varintBytes = encodeVarint(data.length);
  return [...varintBytes, ...data];
}