bytes static method

Future<Uint8List> bytes(
  1. Uint8List compressed
)

Asynchronously decompresses a Uint8List that was compressed using Shrink.bytes.

This function reads the compression method from the first byte and applies the appropriate decompression algorithm in a separate isolate:

  • Identity (no compression)
  • ZLIB decompression for ZLIB-compressed data

Note: For backward compatibility, it also supports legacy compression methods from versions prior to 1.5.6.

Returns a Future containing the original uncompressed Uint8List. The future may complete with an ArgumentError if the input is empty. The future may complete with an UnsupportedError if the compression method is unknown. The future may complete with a FormatException if the compressed data is corrupted.

Implementation

static Future<Uint8List> bytes(Uint8List compressed) {
  return compute(_restoreBytesIsolate, compressed);
}