Closed Hakkoos closed 7 months ago
I meant to say also data1!.isGzipped is always returning FALSE
Try this for the inflate: status = inflateInit2_(&stream, -MAX_WBITS, ZLIB_VERSION, STREAM_SIZE)
And for the deflate: status = deflateInit2_(&stream, level, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY, ZLIB_VERSION, STREAM_SIZE)
This issue was closed because it has been inactive for years since the last update and may be outdated. Please post a new comment if you still have an issue.
I am getting Incorrect Header and also data1!.isGzipped is always returning true for my data. This is what I tried:
I am using this code
let data1 = rootArr.data(using: String.Encoding.utf8, allowLossyConversion: true) if data1!.isGzipped { let unzippedData = try! data1!.gunzipped() print(unzippedData) }
The method isGzipped is looking for anything starting with 0x1f but by the time I convert my string to NSData the encoding will result in the 01xf lost? I am not savvy with encoding.
This is my testing but in real app the data I am bringing from the server is a large json 15MB. I need to break it up and retrieve portions of it that have been zipped and unzip these. When retrieving json I get nsstring and I am trying to convert that to NSData to feed to the GZipSwift
Could anybody tell me how that can be done please
Cheers