add method
Implementation
List<int>? add(List<int> bytes) {
if (_pos >= capacity) {
return bytes;
}
List<int>? remainder;
if (bytes.isNotEmpty) {
var maxAllowed = capacity - _pos;
if (maxAllowed < bytes.length) {
remainder = bytes.sublist(maxAllowed);
}
for (var i = 0; i < min(maxAllowed, bytes.length); i++) {
ptr[_pos++] = bytes[i];
}
}
return remainder;
}