mw99 / DataCompression

Swift libcompression wrapper as an extension for the Data type (GZIP, ZLIB, LZFSE, LZMA, LZ4, deflate, RFC-1950, RFC-1951, RFC-1952)
Apache License 2.0
287 stars 57 forks source link

NOT work for ZLIB in iOS 9.x #4

Closed phasedarray closed 6 years ago

phasedarray commented 6 years ago

I got zlib compressed data from network and invoke data.inflate() to decompress. It works fine in iOS 11 simulator, but fails in iOS 9 simulator. The function _compression_streamprocess in DataCompression.swift always return -1. Neither zlib level-5 nor level-10 can be decompressed Same data can be decompressed by SWCompression in iOS9, so I think it's a bug in this library.

XCode Version 9.1 (9B55) iOS 9.x simulator

mw99 commented 6 years ago

Hi. Thanks for your feedback.

Can you try .unzip() just in case. If that doesn't do the trick can you provide some test data or just post the first ~12 bytes of your compressed stream here? (hex encoded)