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
286 stars 57 forks source link

ZLIB compression and decompression #3

Closed brettmwright closed 6 years ago

brettmwright commented 7 years ago

I have been able to get compression and decompression to work just fine with every algorithm except the ones pertaining to ZLIB. So pretty much just deflate/inflate and compress/decompress with .ZLIB. I am taking a URL, getting it's data representation and passing it into the compression method and then posting it to the server. For decompression I am pulling the data down from the server, passing it into the decompression method and the creating a URL with the decompressed data. Like I said this process has worked every time as long as I am not using ZLIB. I am pretty much trying to see if anyone has had this problem in the past. Thanks.

mw99 commented 7 years ago

Hi,

looks like something is happening to your data while transferring it. When you use the .zip() method, please make sure the first byte of the compressed data is 0x78 before uploading and after downloading it from your server. Also check if it has the same length.