title: Determining GZIPOutputStream behavior
body: <p>The following code produces files which is deterministic (shasum is the same) for two strings.</p>
  
  <pre><code>    try(
              FileOutputStream fos = new FileOutputStream(saveLocation);
              GZIPOutputStream zip = new GZIPOutputStream(fos, GZIP_BUFFER_SIZE);
              BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(zip, StandardCharsets.UTF_8));
              ){
          writer.append(str);
      }
  </code></pre>
  
  <p>Produces:</p>
  
  <pre><code>a.gz f0200d53f7f9b35647b5dece0146d72cd1c17949
  </code></pre>
  
  <p>However, if I take the file on the command line and re-zip it, it produces a different result</p>
  
  <pre><code>&gt; gunzip -n a.gz ;gzip -n a ; shasum a.gz 
  
  50f478a9ceb292a2d14f1460d7c584b7a856e4d9  a.gz
  </code></pre>
  
  <p>How can I get it to match the original sha using /usr/bin/gzip and gunzip ?</p>