mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
26 lines
456 B
Swift
26 lines
456 B
Swift
// Copyright (c) 2026 Timofey Solomko
|
|
// Licensed under MIT License
|
|
//
|
|
// See LICENSE for license information
|
|
|
|
import Foundation
|
|
|
|
extension CompressionMethod {
|
|
|
|
init(_ compression: UInt16) {
|
|
switch compression {
|
|
case 0:
|
|
self = .copy
|
|
case 8:
|
|
self = .deflate
|
|
case 12:
|
|
self = .bzip2
|
|
case 14:
|
|
self = .lzma
|
|
default:
|
|
self = .other
|
|
}
|
|
}
|
|
|
|
}
|