Einzelnen Beitrag anzeigen

Benutzerbild von MSo
MSo

Registriert seit: 22. Jun 2010
Ort: DD
10 Beiträge
 
Delphi XE3 Starter
 
#19

AW: XE2: gzip-Datei mittels System.ZLib dekomprimieren

  Alt 14. Sep 2012, 11:18
Den Header zu interpretieren scheint die ZLib als Fähigkeit schon mitzubringen.

Zitat http://www.zlib.net/manual.html
Zitat:
windowBits can also be zero to request that inflate use the window size in the zlib header of the compressed stream.

windowBits can also be –8..–15 for raw inflate. In this case, -windowBits determines the window size. inflate() will then process raw deflate data, not looking for a zlib or gzip header, not generating a check value, and not looking for any check values for comparison at the end of the stream. This is for use with other formats that use the deflate compressed data format such as zip. Those formats provide their own check values. If a custom format is developed using the raw deflate format for compressed data, it is recommended that a check value such as an adler32 or a crc32 be applied to the uncompressed data as is done in the zlib, gzip, and zip formats. For most applications, the zlib format should be used as is. Note that comments above on the use in deflateInit2() applies to the magnitude of windowBits.

windowBits can also be greater than 15 for optional gzip decoding. Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (the zlib format will return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a crc32 instead of an adler32.
LUnZip := TZDecompressionStream.Create(LInput,15+16); funktioniert auch.
  Mit Zitat antworten Zitat