Extracting zip file into a folder throws "Invalid entry size (expected 46284 but got 46285 bytes)" for one of the entry
<p>When I am trying to extract the zip file into a folder as per the below code, for one of the entry (A text File) getting an error as "Invalid entry size (expected 46284 but got 46285 bytes)" and my extraction is stopping abruptly. My zip file contains around 12 text files and 20 TIF files. It is encountering the problem for the text file and is not able to proceed further as it is coming into the Catch block.
I face this problem only in Production Server which is running on Unix and there is no problem with the other servers(Dev, Test, UAT).
We are getting the zip into the servers path through an external team who does the file transfer and then my code starts working to extract the zip file.</p>

<pre><code>    ...
    int BUFFER = 2048;
    java.io.BufferedOutputStream dest = null;
    String ZipExtractDir = "/y34/ToBeProcessed/";
    java.io.File MyDirectory = new java.io.File(ZipExtractDir);
    MyDirectory.mkdir();
    ZipFilePath = "/y34/work_ZipResults/Test.zip";

    // Creating fileinputstream for zip file
    java.io.FileInputStream fis = new java.io.FileInputStream(ZipFilePath);

    // Creating zipinputstream for using fileinputstream
    java.util.zip.ZipInputStream zis = new java.util.zip.ZipInputStream(new java.io.BufferedInputStream(fis));
    java.util.zip.ZipEntry entry;
    while ((entry = zis.getNextEntry()) != null)
    {
        int count;
        byte data[] = new byte[BUFFER];
        java.io.File f = new java.io.File(ZipExtractDir + "/" + entry.getName());

        // write the files to the directory created above
        java.io.FileOutputStream fos = new java.io.FileOutputStream(ZipExtractDir + "/" + entry.getName());
        dest = new java.io.BufferedOutputStream(fos, BUFFER);
        while ((count = zis.read(data, 0, BUFFER)) != -1)
        {
            dest.write(data, 0, count);
        }
        dest.flush();
        dest.close();
    }
    zis.close();
    zis.closeEntry();
}
catch (Exception Ex)
{
    System.Out.Println("Exception in \"ExtractZIPFiles\"---- " + Ex.getMessage());
}
</code></pre>
