-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64fa05f
commit 52e0757
Showing
9 changed files
with
59 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/xxx/DataDescriptorOut.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package ru.olegcherednik.zip4jvm.io.out.entry.xxx; | ||
|
||
import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; | ||
import ru.olegcherednik.zip4jvm.io.writers.DataDescriptorWriter; | ||
import ru.olegcherednik.zip4jvm.model.DataDescriptor; | ||
import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* @author Oleg Cherednik | ||
* @since 29.10.2024 | ||
*/ | ||
public final class DataDescriptorOut { | ||
|
||
public void write(ZipEntry zipEntry, DataOutput out) throws IOException { | ||
if (!zipEntry.isDataDescriptorAvailable()) | ||
return; | ||
|
||
DataDescriptor dataDescriptor = new DataDescriptor(zipEntry.getChecksum(), | ||
zipEntry.getCompressedSize(), | ||
zipEntry.getUncompressedSize()); | ||
DataDescriptorWriter.get(zipEntry.isZip64(), dataDescriptor).write(out); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/xxx/UpdateZip64.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package ru.olegcherednik.zip4jvm.io.out.entry.xxx; | ||
|
||
import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; | ||
|
||
import static ru.olegcherednik.zip4jvm.model.ZipModel.MAX_ENTRY_SIZE; | ||
import static ru.olegcherednik.zip4jvm.model.ZipModel.MAX_LOCAL_FILE_HEADER_OFFS; | ||
import static ru.olegcherednik.zip4jvm.model.ZipModel.MAX_TOTAL_DISKS; | ||
|
||
/** | ||
* @author Oleg Cherednik | ||
* @since 29.10.2024 | ||
*/ | ||
public final class UpdateZip64 { | ||
|
||
public void update(ZipEntry zipEntry) { | ||
if (zipEntry.getCompressedSize() > MAX_ENTRY_SIZE) | ||
zipEntry.setZip64(true); | ||
if (zipEntry.getUncompressedSize() > MAX_ENTRY_SIZE) | ||
zipEntry.setZip64(true); | ||
if (zipEntry.getDiskNo() > MAX_TOTAL_DISKS) | ||
zipEntry.setZip64(true); | ||
if (zipEntry.getLocalFileHeaderRelativeOffs() > MAX_LOCAL_FILE_HEADER_OFFS) | ||
zipEntry.setZip64(true); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters