replaceVersionBytes function
Implementation
Uint8List replaceVersionBytes(List<int> bytes, Version target) {
if (bytes.length < 4) {
throw ArgumentException.invalidLength(
"Expected byte length: 4, Found: ${bytes.length}");
}
bytes.replaceRange(0, 4, target.bytes);
return Uint8List.fromList(bytes);
}