feal87
feal87

Reputation: 947

Gzip In-Memory Compression

Quick and simple question.

There are examples online about achieving in-memory gzip compression with zlib (C++) WITHOUT external libraries (like boost or such)?

I just need to compress and decompress a block of data without much options. (it must be gzip as its the same format used by another mine C# program (the data is to be shared))

Tried to search to no avail... Thanks!

Upvotes: 3

Views: 6551

Answers (2)

Greg Hewgill
Greg Hewgill

Reputation: 994947

This isn't a complete answer to your question, but you will probably be interested in How can I decompress a gzip stream with zlib?. There is a little bit of poorly documented magic that you need to supply in order for zlib to work with gzip streams.

The zlib API has many functions for doing in-memory compression that don't depend on actual files on disk.

Upvotes: 2

Will
Will

Reputation: 75683

You use an external library called zlib. You could statically link against this library if you did not want to bundle the DLL with your program.

zlib works happily with in-memory buffers.

You do not require boost.

Upvotes: 3

Related Questions