I'm using Delphi XE 8 and trying to decompress a gzip file. I've copied the following code straight from the Embarcadero website as an example, but I get "EZDecompressionError with message 'data error'.
procedure DecompressGzip(inFileName : string);
var
LInput, LOutput: TFileStream;
LUnZip: TZDecompressionStream;
begin
{ Create the Input, Output, and Decompressed streams. }
LInput := TFileStream.Create(InFileName, fmOpenRead);
LOutput := TFileStream.Create(ChangeFileExt(InFileName, 'txt'), fmCreate);
LUnZip := TZDecompressionStream.Create(LInput);
{ Decompress data. }
LOutput.CopyFrom(LUnZip, 0);
{ Free the streams. }
LUnZip.Free;
LInput.Free;
LOutput.Free;
end;
An example file I'm trying to decompress is located here: http://ftp.nhc.noaa.gov/atcf/aid_public/