[erlang-bugs] [zlib] default values to deflateInit

Patrick Baggett <>
Thu Oct 24 16:16:50 CEST 2013

Hey Michal,

I'm a part-time Erlang users and not very strong in it, however, I am
somewhat familiar with zlib in C, and the Erlang API seems to be almost
identical - minus the really gross stuff, of course. ;)

I'm not sure about the default values for zlib:deflateInit() -- it seems
like you should check the source and see how the /2 function is defined.
You use deflateInit() to initialize it, deflateEnd() to end it, and
deflate() as many times as you need. To compress smaller parts, simply pass
slices of data to deflate() rather than the whole buffer. If I
misunderstood your question, please let me know.


On Wed, Oct 23, 2013 at 5:31 AM, Michal Struś <>wrote:

> Hello everyone,
> when I use:
> "zlib:deflateInit(Zstream, Level, deflated, 31, 8, default)"
> everything seems to be fine, but
> "zlib:deflateInit(Zstream, Level)"
> so the above with the same default values is not working for me.
> Is it some kind of bug?
> Second thing:
> can I open Zstream then compress chunks of data in a loop or I HAVE to
> open zstream, deflateInit, deflate, deflateEnd and close zstream -
> everything in one loop? because the first option is also not working for
> me... but maybe it's irrelevant from optimization point of view?
> I'm using Erlang R15B (erts-5.9).
> _______________________________________________
> erlang-bugs mailing list
> http://erlang.org/mailman/listinfo/erlang-bugs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20131024/1925f522/attachment.html>

More information about the erlang-bugs mailing list