Open inigonavenio opened 2 years ago
I received the same error on my device. Turns out that the gzip'ed data was not complete. Make sure that you are flushing / closing the stream when generating the gzip data. The error message that I received was not clear.
I have encountered an issue while gunzipping a file 52KB size long. I mention size as I reckon that is the root cause.
public var isGzipped: Bool
works correctly, and recognises the file as such, a gzipped file. However, library fails to gunzip it and throws and error when usingpublic func gunzipped() throws -> Data
Error thrown looks as follows: ▿ GzipError
Reading through zlib documentation, seems like
Z_BUF_ERROR is not fatal
(this is what causes GzipSwift to eventually throw Gzip.GzipError.Kind.buffer),and deflate() can be called again with more input and more output space to continue compressing.
I'm attaching the above mentioned file, in hopes that this issue gets resolved by contributors soon / at some point :)
UPONAN_gzip.txt