ZlibArchive

public final class ZlibArchive: Archive

A class with unarchive function for Zlib archives.

  • Unarchives Zlib archive stored in archiveData.

    If data passed is not actually a zlib archive, ZlibError will be thrown.

    If data inside the archive is not actually compressed with DEFLATE algorithm, DeflateError will be thrown.

    Note

    This function is specification compliant.

    Parameter

    Parameter archiveData: Data compressed with zlib.

    Throws

    DeflateError or ZlibError depending on the type of inconsistency in data. It may indicate that either the data is damaged or it might not be compressed with zlib or DEFLATE at all.

    Returns

    Unarchived data.

    Declaration

    Swift

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

    Parameters

    archiveData

    Data compressed with zlib.

    Return Value

    Unarchived data.