toBytes method
Serializes this bundle as gzip-compressed JSON bytes.
Compact format suitable for network transfer and in-memory storage. For file distribution, prefer toZip / saveToFile.
Implementation
List<int> toBytes() {
final jsonString = jsonEncode(toJson());
return gzip.encode(utf8.encode(jsonString));
}