[Zlib-devel] compressBound

Jan Ringoš tringi at mx-3.cz
Mon Feb 28 19:26:19 EST 2005


Hi,

I would like to ask, how exact the compressBound function is?
I see the function is pretty simple, so I am afraid that the actual maximum
compress' output size may be smaller.

Well my problem is to get as many compressed data as possible into up to 65472
bytes long clusters. For simplicity I use compress/uncompress function to
compress 65443 bytes of data (compressBound (65472)).

I would like to know, if it is possible and absolutely safe to write more. My
current testing says that I may compress 65446 bytes and even with random data I
still get exactly into 65472 bytes boundary. But I would like to be sure, not to
get crashing in some rare situation.

I know, it is only 3 bytes, but it may save me from allocating 4096 bytes long 
sector ;-)

---
Jan Ringoš, Tringi at Mx-3.cz
http://Tringi.Mx-3.cz

n.v.t. MX-3, www.mx-3.cz





More information about the Zlib-devel mailing list