bytes static method

Uint8List bytes(
  1. Uint8List bytes
)

Compresses a Uint8List using zlib compression or no compression (identity).

This function tries different compression levels to find the optimal compression:

  • No compression (identity) - used when compression would increase size
  • ZLIB compression with levels 4-9

The first byte of the returned Uint8List indicates the compression method used, followed by the compressed data.

Returns a compressed Uint8List using the most efficient method for the input data. The compression is lossless - the original data can be fully restored.

Implementation

static Uint8List bytes(Uint8List bytes) {
  return shrinkBytes(bytes);
}