I am trying to programmatically decompress a .xml.gz file. It seems to be all pretty straightforward as there are many examples available on the internet which tell you how to decompress a .gz file. However, every-time I try to do it, I get an exception: java.io.IOException: unknown format (magic number d4d4).
I’m trying to do this in an Android app, is it supposed to be done differently from the way its done otherwise in Java?
I’m following this example code available here.
Anyone have any idea what I’m doing wrong here? Also, I’m decompressing the file after I have downloaded it from the a web server. The download seems to have worked fine.
Found a nice way of downloading an decompressing at the same time. It works like a breeze.
Reference: http://abhirampal.com/2012/05/17/android-download-decompress-gzip/