 /// A strucutre which provides information about gzip archive.
 public struct GzipHeader {
 
+    struct Flags {
+        static let ftext: UInt8 = 0x01
+        static let fhcrc: UInt8 = 0x02
+        static let fextra: UInt8 = 0x04
+        static let fname: UInt8 = 0x08
+        static let fcomment: UInt8 = 0x10
+    }
+
     /// Supported compression methods in gzip archive.
     public enum CompressionMethod: Int {
         case deflate = 8

        var out: [UInt8] = []

        while !pointerData.isAtTheEnd {
            _ = try self.serviceInfo(pointerData)

            let memberData = try Deflate.decompress(&pointerData)


                fcommentBytes.append(byte)
                headerBytes.append(byte)
            }
            self.comment = String(data: Data(fcommentBytes), encoding: .utf8)
        } else {
            self.comment = nil
        }

        // Some archives may contain 2-bytes checksum
        if flags & Flags.fhcrc != 0 {
            // Note: it is not actual CRC-16, it is just two least significant bytes of CRC-32.
            let crc16 = pointerData.intFromAlignedBytes(count: 2)
            let ourCRC32 = CheckSums.crc32(headerBytes)
            guard ourCRC32 & 0xFFFF == crc16 else { throw GzipError.WrongHeaderCRC }
        }
    }

}

/// A class with unarchive function for gzip archives.
public final class GzipArchive: Archive {

    /**
     Unarchives gzip archive stored in `archiveData`.
