10-16-2018, 08:34 PM
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, 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)" in
IdZLib:
class procedure EZlibError.RaiseException(const AError: Integer);
var
LException: EZlibError;
begin
LException := CreateFmt(sZLibError, [AError]);
LException.FErrorCode := AError;
raise LException;
end;
I tried 3 different IdZLibHeaders but no difference.
I cannot find any documentation on the error, and it also does not show where it actually occurs.
Why is the Decompression not working?
Delphy 10.2.3
Bart
There is a reason I want to do this manually, instead of using the Indy IdCompressionIntercept, 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)" in
IdZLib:
class procedure EZlibError.RaiseException(const AError: Integer);
var
LException: EZlibError;
begin
LException := CreateFmt(sZLibError, [AError]);
LException.FErrorCode := AError;
raise LException;
end;
I tried 3 different IdZLibHeaders but no difference.
I cannot find any documentation on the error, and it also does not show where it actually occurs.
Why is the Decompression not working?
Delphy 10.2.3
Bart