'Java 7 Zip-JBinding Truncated zip file extracted from ISO

I am using below code (link to full code) to extract zip file which is inside iso file using 7-zip-JBinding.

    for (ISimpleInArchiveItem item : simpleInArchive.getArchiveItems()) {
                    final int[] hash = new int[] { 0 };
                    if (!item.isFolder()) {
                        ExtractOperationResult result;
    
                        final long[] sizeArray = new long[1];
                        result = item.extractSlow(new ISequentialOutStream() {
                            public int write(byte[] data) throws SevenZipException {
                                hash[0] ^= Arrays.hashCode(data); // Consume data
                                sizeArray[0] += data.length;
                                return data.length; // Return amount of consumed data
                            }
                        });
    
                        if (result == ExtractOperationResult.OK) {
                            System.out.println(String.format("%9X | %10s | %s", 
                                    hash[0], sizeArray[0], item.getPath()));
                        } else {
                            System.err.println("Error extracting item: " + result);
                        }
                    }
                }

It works fine for some of the file (e.g. this file which is 1.74 GB), but when I try to use it with this file which is 4.01 GB, it is getting truncated and extracted file is only of 8.26 MB zip file from ISO whereas actual ZIP file size is 4.00 GB.

How do I resolve this issue? Is there any configuration that is restricting this file to extract appropriately which I need to change?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source