QByteArray qUncompress on non-Qt apps
-
I have a webservice running on Qt and in it there's a method returning a compressed file (using the QByteArray qCompress with level 9). Now I am trying to get to decompress it in another mobile application (not Qt) that's connecting to this WS, but I have no idea which algorithm to use. I've tried using zlib, regular base64, gunzip, etc... and all my attempts have not yielded results so far. What is the right algorithm to use? Has anyone experienced anything that could help me?
-
I have a webservice running on Qt and in it there's a method returning a compressed file (using the QByteArray qCompress with level 9). Now I am trying to get to decompress it in another mobile application (not Qt) that's connecting to this WS, but I have no idea which algorithm to use. I've tried using zlib, regular base64, gunzip, etc... and all my attempts have not yielded results so far. What is the right algorithm to use? Has anyone experienced anything that could help me?
-
@Jeevo
I believeqCompress
simply wraps zlib calls. You could verify in the sources of your Qt version. -
@JonB Haven't thought about that. Looking at the code it seems to use zlibs compress2. I will see if I can decompress that now, thank you Jon.
@Jeevo It's properly documented: https://doc.qt.io/qt-6/qbytearray.html#qCompress and https://doc.qt.io/qt-6/qbytearray.html#qUncompress-1