concatBytes function

Uint8List concatBytes(
  1. List<Uint8List> parts
)

Implementation

Uint8List concatBytes(List<Uint8List> parts) {
  var total = 0;
  for (final p in parts) {
    total += p.length;
  }
  final out = Uint8List(total);
  var offset = 0;
  for (final p in parts) {
    out.setAll(offset, p);
    offset += p.length;
  }
  return out;
}