mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
Small updates to comments in a couple of cases
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 ""
|
||||
|
||||
Reference in New Issue
Block a user