Better HN
topnewbestaskshowjobs
Log inSign up

throwaway8163

4 karma · joined Sep 20, 2023 (3y ago) · 1 submissions

Submissions

comment 3y ago · link · parent

Some compression formats such as gzip support encoding streams.

This is useful when you don't know the size in advance, or if you compress on demand and want the receiver to start reading while the sender is still compressing.

One example could be a web service where you request dynamic content (like a huge CSV file). The client can start downloading earlier, and the server doesn't need to create a temporary file. The web service will stream the results directly and encoding it in chunks.