title: Android Decompress downloaded .xml.gz file
body: <p>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).</p>
  
  <p>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?</p>
  
  <p>I'm following this example code available <a href="http://www.java2s.com/Tutorial/Java/0180__File/UnzipafilewithGZIPInputStream.htm" rel="nofollow">here</a>.</p>
  
  <p>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.</p>