views:

247

answers:

2

I'm interested on documentation of the deflate stream format or deflate algorithm which goes beyond RFC1951. Sample streams, implementation hints whatever may be interesting.

A: 

You could just use zlib rather than rolling your own?

To support pre-compressed preambles, you could:

Use the raw API (those using z_streamp as a parameter) rather than the higher level wrappers.

Initialise the compressed preamble with it's own z_streamp and place the output in a buffer.

Then for all subsequent uses of the preamble, copy the preamble output buffer to the output, and copy the preamble's z_streamp and use that copy for compressing the subsequent bytes.

Will
No, i couldn't because i need some functions that zlib don't provide.
Thomas Maierhofer
What functions? If you're specific, we might be able to help.
Will
I need the possibility to insert pre compressed data in a deflate stream. I think it is hard to do. I've described the problem already in this question: http://stackoverflow.com/questions/1410533/deflate-compression-stream-where-pre-compressed-data-can-be-inserted-does-a-net
Thomas Maierhofer
+1  A: 

I worked on a streaming implementation of deflate once and found this description helpful:

http://www.zlib.net/feldspar.html

At first I tried the zlib source, but it is not an easy read.

David Crawshaw