Skip to content

Commit 5b74372

Browse files
committed
set Zip64Mode.AsNeeded
1 parent 0cacc5b commit 5b74372

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/main/java/dev/zarr/zarrjava/store/BufferedZipStore.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
import java.util.stream.Stream;
1212

1313
import org.apache.commons.compress.archivers.ArchiveEntry;
14-
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
15-
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
16-
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
17-
import org.apache.commons.compress.archivers.zip.Zip64Mode;
14+
import org.apache.commons.compress.archivers.zip.*;
1815

1916
import java.util.zip.CRC32;
2017
import java.util.zip.ZipEntry; // for STORED constant
@@ -32,14 +29,11 @@ private void writeBuffer() throws IOException{
3229
// create zip file bytes from buffer store and write to underlying store
3330
ByteArrayOutputStream baos = new ByteArrayOutputStream();
3431
try (ZipArchiveOutputStream zos = new ZipArchiveOutputStream(baos)) {
35-
// always use zip64
36-
zos.setUseZip64(Zip64Mode.Always);
37-
// set archive comment if provided
32+
zos.setUseZip64(Zip64Mode.AsNeeded);
3833
if (archiveComment != null) {
3934
zos.setComment(archiveComment);
4035
}
4136

42-
// iterate all entries provided by bufferStore.list()
4337
bufferStore.list().forEach(keys -> {
4438
try {
4539
if (keys == null || keys.length == 0) {

0 commit comments

Comments
 (0)