title: changing contents of file inside zip file
body: <p>I followed the below link to edit the contents of a zip file and write to another zip file.</p>
  
  <p><a href="https://stackoverflow.com/questions/11502260/modifying-a-text-file-in-a-zip-archive-in-java">orignal post here</a></p>
  
  <p>when i follow this it seems to work ok except for the last iteration where i get </p>
  
  <pre><code>java.util.zip.ZipException: invalid entry compressed size (expected 1780     
  but got 1787 bytes)
  at java.util.zip.ZipOutputStream.closeEntry(ZipOutputStream.java:217)
  at  com.dtcc.cdts.components.configdeploy.renameBRKXML.main(renameBRKXML.java:66)
  </code></pre>
  
  <p>i did have the </p>
  
  <pre><code>zos.write(buf, 0, (len &lt; buf.length) ? len : buf.length);
  </code></pre>
  
  <p>Please help</p>