Small updates to comments in a couple of cases

This commit is contained in:
Timofey Solomko
2017-10-28 17:50:00 +03:00
parent 4cab7c1ff3
commit dc6ad70168
3 changed files with 2 additions and 3 deletions
-1
View File
@@ -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.
+1 -2
View File
@@ -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()
+1
View File
@@ -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 ""