snappyCompress method

Bytes snappyCompress({
  1. int level = 1,
})

Compresses this view into a new Bytes using the block format.

Slicing is zero-copy on both sides: the result is a Bytes view over the encoder's output buffer, exactly as long as the compressed stream. level is 1 (fastest, the default) or 2 (denser and slower).

Implementation

Bytes snappyCompress({int level = 1}) =>
    Bytes.fromUint8List(Snappy.compress(asUint8List(), level: level));