{"action":"opened","issue":{"url":"https://api.github.com/repos/Frommi/miniz_oxide/issues/24","repository_url":"https://api.github.com/repos/Frommi/miniz_oxide","labels_url":"https://api.github.com/repos/Frommi/miniz_oxide/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/Frommi/miniz_oxide/issues/24/comments","events_url":"https://api.github.com/repos/Frommi/miniz_oxide/issues/24/events","html_url":"https://github.com/Frommi/miniz_oxide/issues/24","id":313955774,"number":24,"title":"Clarifications about streaming support","user":{"login":"golddranks","id":2675542,"avatar_url":"https://avatars1.githubusercontent.com/u/2675542?v=4","gravatar_id":"","url":"https://api.github.com/users/golddranks","html_url":"https://github.com/golddranks","followers_url":"https://api.github.com/users/golddranks/followers","following_url":"https://api.github.com/users/golddranks/following{/other_user}","gists_url":"https://api.github.com/users/golddranks/gists{/gist_id}","starred_url":"https://api.github.com/users/golddranks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/golddranks/subscriptions","organizations_url":"https://api.github.com/users/golddranks/orgs","repos_url":"https://api.github.com/users/golddranks/repos","events_url":"https://api.github.com/users/golddranks/events{/privacy}","received_events_url":"https://api.github.com/users/golddranks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-13T03:16:01Z","updated_at":"2018-04-13T03:16:01Z","closed_at":null,"author_association":"NONE","body":"Hi, I'm developing a streaming .ZIP library that uses miniz_oxide for decompressing DEFLATE. Streaming is hard because you get the data in smaller chunks and want to decompress incrementally. Because of some peculiarities of the .ZIP format, you don't sometimes even know the size of the data beforehands. Here's my library (WIP): https://github.com/golddranks/stream_zipper\r\n\r\nI've managed to get decompression to work when parsing files as one chunk. However, incremental decompression is giving me trouble. I'd like to ask some questions which I'd hope get eventually clarified in documentation:\r\n\r\n1) What's the difference between `FailedCannotMakeProgress` and `NeedsMoreInput` states? If I hand `miniz_oxide` a partial buffer (try `git cloning` my repo and running `cargo test test_partial_decompression -- --nocapture` and see the debug printing; it gives 400 bytes instead of the full buffer), I get `FailedCannotMakeProgress`.\r\n\r\n2) If I want to continue incrementally, what parameters am I supposed to pass? At the moment, I pass the rest of the input buffer (bytes after 400) and make a fresh output buffer, plus reuse the same `DecompressorOxide` struct, but it returns a `Failure`. If I pass the input buffer in one go, it manages to decompress the thing.\r\n\r\n3) If I understand right, DEFLATE stream format has a marker when the stream ends, so knowing the size beforehands isn't required. Is this correct?"}}
{"actor":{"display_login":"golddranks"}}