Treatment compress
compression/deflate::compress
Parameters
↳ var level: i32 = 6
Inputs
⇥ data: Stream<byte>
Outputs
↦ completed: Block<void>
↦ compressed: Stream<byte>
↦ error: Block<string>
↦ failed: Block<void>
↦ finished: Block<void>
Compresses data with deflate.
The bytes received through data are compressed with deflate at level, from 0 (no compression) to 9 (smallest), 6 by default, and given through compressed while they come, as a raw deflate stream, with no header.
Once data ends and everything is given, completed is emitted. If level is not
supported or compression fails, failed is emitted and error contains the reason.
finished is emitted in every case.
graph LR
T("compress()")
B["… 🟦 🟦 🟦"] -->|data| T
T -->|compressed| O["… 🟪 🟪"]
T -->|completed| C["〈🟩〉"]
style B fill:#ffffff,stroke:#ffffff
style O fill:#ffffff,stroke:#ffffff
style C fill:#ffffff,stroke:#ffffff