public byte[] decompress(InputStream is){
  inflater.reset();
  InflaterInputStream iis=new InflaterInputStream(is,inflater);
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  try {
    while (true) {
      int b=iis.read();
      if (b == -1)       break;
      baos.write(b);
    }
  }
 catch (  IOException ex) {
    throw new RuntimeException(ex);
  }
  return baos.toByteArray();
}

public byte [ ] decompress ( InputStream is ) { inflater . reset ( ) ; InflaterInputStream iis = new InflaterInputStream ( is , inflater ) ; ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; try { while ( true ) { int b = iis . read ( ) ; if ( b == - 1 ) break ; baos . write ( b ) ; } } catch ( IOException ex ) { throw new RuntimeException ( ex ) ; } return baos . toByteArray ( ) ; }
decompress an input stream until eof .
