Files
SWCompression/Sources/Zlib/ZlibError.swift
T
2018-01-03 19:44:18 +03:00

27 lines
986 B
Swift

// Copyright (c) 2018 Timofey Solomko
// Licensed under MIT License
//
// See LICENSE for license information
import Foundation
/**
Represents an error, which happened during processing Zlib archive.
It may indicate that either archive is damaged or it might not be Zlib archive at all.
*/
public enum ZlibError: Error {
/// Compression method used in archive is different from Deflate, which is the only supported one.
case wrongCompressionMethod
/// Compression info has value incompatible with Deflate compression method.
case wrongCompressionInfo
/// First two bytes of archive's flags are inconsistent with each other.
case wrongFcheck
/// Compression level has value, which is different from the supported ones.
case wrongCompressionLevel
/**
Computed checksum of uncompressed data doesn't match the value stored in archive.
Associated value of the error contains already decompressed data.
*/
case wrongAdler32(Data)
}