Skip to content

Commit

Permalink
#463 Fix endOfCentralDirectory location calculation when setting comment
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanth-lingala committed Aug 30, 2022
1 parent 9c7bb74 commit 5024127
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/net/lingala/zip4j/headers/HeaderWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public void finalizeZipFileWithoutValidations(ZipModel zipModel, OutputStream ou
}

try(ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
long offsetCentralDir = zipModel.getEndOfCentralDirectoryRecord().getOffsetOfStartOfCentralDirectory();
long offsetCentralDir = getOffsetOfCentralDirectory(zipModel);
writeCentralDirectory(zipModel, byteArrayOutputStream, rawIO, charset);
int sizeOfCentralDir = byteArrayOutputStream.size();

Expand Down

0 comments on commit 5024127

Please sign in to comment.