mergeBytes static method
Implementation
static ByteData mergeBytes(List<ByteData> bytesList) {
if (bytesList.length == 1) {
return bytesList[0];
}
var totalLen = 0;
for (var bytes in bytesList) {
totalLen += bytes.lengthInBytes;
}
var output = ByteData(totalLen);
var pos = 0;
for (var bytes in bytesList) {
output.buffer.asUint8List(pos).setAll(0, toUint8List(bytes));
pos += bytes.lengthInBytes;
}
return output;
}