ZlibArchive

public class ZlibArchive : Archive

Provides unarchive and archive functions for Zlib archives.

  • Unarchives Zlib archive.

    Note

    This function is specification compliant.

    Throws

    DeflateError or ZlibError depending on the type of the problem. It may indicate that either archive is damaged or it might not be archived with Zlib or compressed with Deflate at all.

    Declaration

    Swift

    public static func unarchive(archive data: Data) throws -> Data

    Parameters

    archive

    Data archived with Zlib.

    Return Value

    Unarchived data.

  • Archives data into Zlib archive. Data will be also compressed with Deflate algorithm. It will also be specified in archive’s header that the compressor used the slowest Deflate algorithm.

    Note

    This function is specification compliant.

    Declaration

    Swift

    public static func archive(data: Data) -> Data

    Parameters

    data

    Data to compress and archive.

    Return Value

    Resulting archive’s data.