It would be useful to work out if Apache POI SXSSFWorkbook should default to 
https://commons.apache.org/proper/commons-compress/apidocs/org/apache/commons/compress/archivers/zip/Zip64Mode.html#AlwaysWithCompatibility

It would probably make sense to contact LibreOffice before contacting 
Commons-Compress. The latter would likely only be interested if there was a bug 
in their implementation.





On Friday 11 October 2024 at 00:13:37 IST, Andreas Reichel 
<andr...@manticore-projects.com> wrote: 





On Thu, 2024-10-10 at 23:03 +0000, PJ Fanning wrote:
> workBook.setZip64Mode(Zip64Mode.Never);
>
> Some tools may not be able to handle Zip64 mode.

You are my hero! The following works and no corruption.
Please don't allow/set Zip64Mode.Never, it will hang forever and is
hard to kill.

Now, who is to blame and where to report this problem to? Is is Commons
Compress or LibreOffice?

Thank you so much for the hint and help!

public class Main {
    public static void main(String[] args) {
        // this will cause corruption
        SXSSFWorkbook wb  = new SXSSFWorkbook(new XSSFWorkbook(), 100, true, 
true);
        SXSSFSheet sheet = wb.createSheet("test");
        wb.setZip64Mode(Zip64Mode.AlwaysWithCompatibility);


        File outputFile = null;
        try {
            outputFile = File.createTempFile("poitest_", ".xlsx");
            FileOutputStream fileOutputStream = new 
FileOutputStream(outputFile);
            wb.write(fileOutputStream);
            wb.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
For additional commands, e-mail: user-h...@poi.apache.org

Reply via email to