title: Unzipping file Zip Exception: invalid entry size (expected 193144 but got 193138 bytes)
body: <p>I am trying to unzip a file (retrieved from an FTP server):</p>
  
  <pre><code>ZipInputStream zis = new ZipInputStream(
      new FileInputStream(zipFile));
      ZipEntry ze = zis.getNextEntry();
      while (ze != null) {
          String fileName = ze.getName();
          File newFile = new File(outputFileName+outputFolder + File.separator + fileName);
          System.out.println("file unzip : " + newFile.getAbsoluteFile());
          FileOutputStream fos = new FileOutputStream(newFile);
          int len;
          while ((len = zis.read(buffer)) &gt; 0) {
              fos.write(buffer, 0, len);
          }
          fos.close();
          sendFile = newFile;
          ze = zis.getNextEntry();
      }
      zis.closeEntry();
      zis.close();
      System.out.println("Done");
  </code></pre>
  
  <p>I have only one text file in the .zip file. This code works fine on my local windows machine. However, when deployed onto ubuntu server, it throws the following exception..</p>
  
  <pre><code>java.util.zip.ZipException: invalid entry size (expected 193144 but got 193138 bytes)
  at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:386)
  at java.util.zip.ZipInputStream.read(ZipInputStream.java:156)
  at java.io.FilterInputStream.read(FilterInputStream.java:90)
  </code></pre>
  
  <p>at com.empress.Xsync.updater.ClientConfiguration.unZipFile(ClientConfiguration.java:246)</p>
  
  <p>I have manually unzipped it..works fine.
  Original .txt file size is 193144 bytes.</p>