XZError

public enum XZError: Error

Represents an error, which happened during unarchiving XZ archive. It may indicate that either archive is damaged or it might not be XZ archive at all.

  • Either ‘magic’ number in header or footer isn’t equal to a predefined value.

    Declaration

    Swift

    case wrongMagic
  • One of the special fields in archive has an incorrect value, which can mean both damaged archive or that archive uses a newer version of XZ format.

    Declaration

    Swift

    case wrongField
  • Checksum of one of the fields of archive doesn’t match the value stored in archive.

    Declaration

    Swift

    case wrongInfoCRC
  • Either size of decompressed data isn’t equal to the one specified in archive or amount of compressed data read is different from the one stored in archive.

    Declaration

    Swift

    case wrongDataSize
  • Computed checksum of uncompressed data doesn’t match the value stored in the archive. Associated value of the error contains already decompressed data:

    • if unarchive function was called then associated array will have only one element with combined data for all already decompressed streams, including the one with mismatching checksum.
    • if splitUnarchive function was called then associated array will have an element for each already decompressed stream, including the one with mismatching checksum.

    Declaration

    Swift

    case wrongCheck([Data])
  • Padding (null-bytes appended to an archive’s structure) is incorrect.

    Declaration

    Swift

    case wrongPadding
  • Either null byte encountered or exceeded maximum amount bytes during reading multi byte number.

    Declaration

    Swift

    case multiByteIntegerError