Data

extension Data
  • Whether the receiver is compressed in gzip format.

    Declaration

    Swift

    public var isGzipped: Bool { get }
  • Create a new Data object by compressing the receiver using zlib. Throws an error if compression failed.

    Throws

    GzipError

    Declaration

    Swift

    public func gzipped(level: CompressionLevel = .defaultCompression) throws -> Data

    Parameters

    level

    Compression level.

    Return Value

    Gzip-compressed Data object.

  • Create a new Data object by decompressing the receiver using zlib. Throws an error if decompression failed.

    Throws

    GzipError

    Declaration

    Swift

    public func gunzipped() throws -> Data

    Return Value

    Gzip-decompressed Data object.