From: joe bloggs [mailto:[EMAIL PROTECTED] 
> If they decide not to compress the files, the app sets
> the deflate compression level to 0 (indicating that no
> compression is to take place).  This works as expected
> except that the deflate function seems to add a few bytes [...]
> Does anyone know why this extra data is added to every
> chunk passed to the deflate function?  

That's just how the deflate format works, as defined in RFC 1951.

Do your (optionally) compressed files consist only of the raw zlib
stream?  If so, and if you want the option to store a raw uncompressed
byte stream as well (to avoid this inflation issue) then you'll need at
least a small header on the front to indicate which format it is.  If
so, then consider using the full gzip format (RFC 1952).  The gzip
header has fields for the original file name and timestamp and whatnot,
which may be useful as you are compressing files.  It also has a field
("CM") to specify compression method.  Oddly the RFC defines only one
allowable compression method (deflate = 8) and doesn't define one for
the "identity algorithm" of raw bytes.  But you could cheat a little and
define your own compression method code to indicate raw bytes.

-slj-


--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to