I am using legacy api and it seems to work in iOS 15 as well. tested on real device.
let encodedCapacity = 1_000_000
let encodedDestinationBuffer = UnsafeMutablePointer<UInt8>.allocate(capacity: encodedCapacity)
defer {
encodedDestinationBuffer.deallocate()
}
let decodedData: Data = withUnsafeBytes { encodedSourceBuffer in
let typedPointer = encodedSourceBuffer.bindMemory(to: UInt8.self)
let count = compression_decode_buffer(encodedDestinationBuffer, encodedCapacity, typedPointer.baseAddress!, count, nil, COMPRESSION_BROTLI)
return Data(bytes: encodedDestinationBuffer, count: count)
}
return decodedData
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: