Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compression problems
#2
(10-16-2018, 08:34 PM)BartKindt Wrote: I need to compress-decompress streams just before Indy transmits them.

There is a reason I want to do this manually, instead of using the Indy IdCompressionIntercept

And what reason is that exactly?

(10-16-2018, 08:34 PM)BartKindt Wrote: but I still use the Indy functions:

CompressStreamEx(InStream, OutStream, clMax, zsGZip);
and
DecompressStream(InStream, OutStream);.

The problem is, the compression works perfectly, and I can save the Stream to disk, and a 3th party unzip program correctly detect the zip format, and can decompress it.

But when I call DecompressStream(InStream, OutStream), I get a "ZLib Error (-5)"

Error -5 is Z_BUF_ERROR.

(10-16-2018, 08:34 PM)BartKindt Wrote: Why is the Decompression not working?

Maybe it doesn't support GZip? If you look at the implementation of TIdCompressorZLib, its Compress methods use IndyCompressStream() (with extra parameters) and IndyDecompressStream(), whereas the Deflate methods use IndyCompressStream() (without extra parameters) and DecompressStream().

Indy's ZLib streaming has always been troublesome, to say the least. You might be best off just using the ZLib API directly in your own code.

Reply


Messages In This Thread
Compression problems - by BartKindt - 10-16-2018, 08:34 PM
RE: Compression problems - by rlebeau - 10-19-2018, 07:10 PM
RE: Compression problems - by BartKindt - 10-19-2018, 08:21 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)