我有一些使用 C# DeflateStream 类压缩的文件,如下所示:
using (DeflateStream compressionStream = new DeflateStream(compressedFileStream, CompressionMode.Compress))
没什么花哨的,所有的默认值。它使用等效的 C# DeflateStreamCode 解压缩很好,即
using (DeflateStream decompressionStream = new DeflateStream(originalFileStream, CompressionMode.Decompress))
但我需要使用 Delphi 解压缩它。我已经尝试过 zlib 库(XE8,XE10.3),类似以下内容:
InStream := TMemoryStream.Create;
InStream.LoadFromFile('F:\mycompressedfile.x');
DecompressionStream := TDecompressionStream.Create(InStream);
OutStream := TMemoryStream.Create;
OutStream.LoadFromStream(DecompressionStream);
OutStream.SaveToFile('F:\mydecompressedfile.x');
但不断收到“数据错误”消息。如何解压缩 C# DeflateStream 压缩文件?