diff --git a/Sources/GZip/GzipArchive.swift b/Sources/GZip/GzipArchive.swift index b2d3e14e..5b482216 100644 --- a/Sources/GZip/GzipArchive.swift +++ b/Sources/GZip/GzipArchive.swift @@ -93,7 +93,6 @@ public class GzipArchive: Archive { Data will be also compressed with Deflate algorithm. It will be also specified in archive's header that the compressor used the slowest Deflate algorithm. - If during compression something goes wrong `DeflateError` will be thrown. If either `fileName` or `comment` cannot be encoded with ISO Latin-1 encoding, then `GzipError.cannotEncodeISOLatin1` will be thrown. diff --git a/Sources/GZip/GzipHeader.swift b/Sources/GZip/GzipHeader.swift index 5e38cff8..f9a8dda8 100644 --- a/Sources/GZip/GzipHeader.swift +++ b/Sources/GZip/GzipHeader.swift @@ -60,11 +60,10 @@ public struct GzipHeader { guard magic == 0x8b1f else { throw GzipError.wrongMagic } var headerBytes: [UInt8] = [0x1f, 0x8b] - // Third byte is a method of compression. Only type 8 (DEFLATE) compression is supported + // Third byte is a method of compression. Only type 8 (DEFLATE) compression is supported for GZip archives. let method = pointerData.byte() guard method == 8 else { throw GzipError.wrongCompressionMethod } headerBytes.append(method) - self.compressionMethod = .deflate let flags = pointerData.byte() diff --git a/Sources/ZIP/ZipCommon.swift b/Sources/ZIP/ZipCommon.swift index 39f8a73d..7f5a043b 100644 --- a/Sources/ZIP/ZipCommon.swift +++ b/Sources/ZIP/ZipCommon.swift @@ -19,6 +19,7 @@ class ZipCommon { static let cp437Available = CFStringIsEncodingAvailable(cp437Encoding) #endif + // TODO: As extension? static func getStringField(_ pointerData: DataWithPointer, _ length: Int, _ useUtf8: Bool) -> String? { if length == 0 { return ""