GzipHeader

public struct GzipHeader

Represents the header of a GZip archive.

  • Compression method of archive. Always .deflate for GZip archives.

    Declaration

    Swift

    public var compressionMethod: CompressionMethod
  • The most recent modification time of the original file. If corresponding archive’s field is set to 0, which means that no time was specified, then this property is nil.

    Declaration

    Swift

    public var modificationTime: Date?
  • Type of file system on which archivation took place.

    Declaration

    Swift

    public var osType: FileSystemType
  • Name of the original file. If archive doesn’t contain file’s name, then nil.

    Declaration

    Swift

    public var fileName: String?
  • Comment stored in archive. If archive doesn’t contain any comment, then nil.

    Declaration

    Swift

    public var comment: String?
  • True, if file is likely to be text file or ASCII-file.

    Declaration

    Swift

    public var isTextFile: Bool
  • Extra fields present in the header.

    Note

    This feature of the GZip format is extremely rarely used, so in vast majority of cases this property contains an empty array.

    Declaration

    Swift

    public var extraFields: [ExtraField]
  • Initializes the structure with the values from the first ‘member’ of GZip archive.

    Throws

    GzipError. It may indicate that either archive is damaged or it might not be archived with GZip at all.

    Declaration

    Swift

    public init(archive data: Data) throws

    Parameters

    archive

    Data archived with GZip.

  • Represents an extra field in the header of a GZip archive.

    See more

    Declaration

    Swift

    public struct ExtraField