title: How to inflate string that we deflated with Java defaltor
body: <p>I am deflating a string with java with this function:</p>
  
  <pre><code>protected static byte[] Compress(String source) {
      try {
  
          // deficne start time
          long startTime = System.currentTimeMillis();
  
          //get bytes
          byte[] bytes = source.getBytes("UTF-8");
  
          Deflater deflater = new Deflater();
          deflater.setInput(bytes);
          deflater.finish();
          ByteArrayOutputStream bos = new ByteArrayOutputStream(bytes.length);
  
          byte[] buffer = new byte[1024];
          while (!deflater.finished()) {
  
              int bytesCompressed = deflater.deflate(buffer);
              bos.write(buffer, 0, bytesCompressed);
          }
  
          try {
              //close the output stream
              bos.close();
          } catch (IOException ioe) {
              System.out.println("Error while closing the stream : " + ioe);
          }
  
          //get the compressed byte array from output stream
          byte[] compressedArray = bos.toByteArray();
  
          return compressedArray;
      } catch (Exception e) {
          e.printStackTrace();
          return null;
      }
  }
  </code></pre>
  
  <p>now, I want to inflate that string with PHP with this function:</p>
  
  <pre><code>$uncompressed = gzinflate($filepath);
  echo $uncompressed;
  die();
  </code></pre>
  
  <p>but I got data error in php file, how can I solve this problem?</p>
  
  <p>the error message is :</p>
  
  <p><strong>Warning: gzinflate(): data error</strong></p>
  
  <p>regards</p>