From 6cdfc14f54db08cb2cd75672d08527575262ee64 Mon Sep 17 00:00:00 2001 From: Timofey Solomko Date: Sat, 16 Oct 2021 21:57:46 +0300 Subject: [PATCH] [7-Zip] Add support for LZ4 --- Sources/7-Zip/7zFolder.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/7-Zip/7zFolder.swift b/Sources/7-Zip/7zFolder.swift index a463f3e5..2055d56b 100644 --- a/Sources/7-Zip/7zFolder.swift +++ b/Sources/7-Zip/7zFolder.swift @@ -186,6 +186,12 @@ class SevenZipFolder { else { throw SevenZipError.internalStructureError } decodedData = DeltaFilter.decode(LittleEndianByteReader(data: decodedData), (properties[0] &+ 1).toInt()) + } else if coder.id == [0x04, 0xF7, 0x11, 0x04] { + #if (!SWCOMPRESSION_POD_SEVENZIP) || (SWCOMPRESSION_POD_SEVENZIP && SWCOMPRESSION_POD_LZ4) + decodedData = try LZ4.decompress(data: decodedData) + #else + throw SevenZipError.compressionNotSupported + #endif } else if coder.isEncryptionMethod { throw SevenZipError.encryptionNotSupported } else {