encode static method
Encodes bytes with GZip at level (-1 to 9).
Implementation
static Uint8List encode(Uint8List bytes, {int level = defaultLevel}) {
var encoded = ZLibEncoder(gzip: true, level: level).convert(bytes);
return encoded is Uint8List ? encoded : Uint8List.fromList(encoded);
}