Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Treatment decompress

compression/zlib::decompress


Inputs

⇥ data: Stream<byte>

Outputs

↦ completed: Block<void>
↦ decompressed: Stream<byte>
↦ error: Block<string>
↦ failed: Block<void>
↦ finished: Block<void>


Decompresses data compressed with zlib.

The bytes received through data, compressed with zlib, are decompressed and given through decompressed while they come.

Once data ends with a complete zlib stream and everything is given, completed is emitted. If data is not valid zlib, or ends before its end, failed is emitted and error contains the reason: what was given before does not make the whole data. finished is emitted in every case.

graph LR
     T("decompress()")
     B["… 🟪 🟪"] -->|data| T

     T -->|decompressed| O["… 🟦 🟦 🟦"]
     T -->|completed| C["〈🟩〉"]

     style B fill:#ffffff,stroke:#ffffff
     style O fill:#ffffff,stroke:#ffffff
     style C fill:#ffffff,stroke:#ffffff