Skip to content

Commit

Permalink
#287 Set entryClosed flag to true on ZipOutputStream initialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanth-lingala committed May 25, 2021
1 parent f88f0fb commit a0b9dee
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class ZipOutputStream extends OutputStream {
private long uncompressedSizeForThisEntry = 0;
private Zip4jConfig zip4jConfig;
private boolean streamClosed;
private boolean entryClosed = false;
private boolean entryClosed = true;

public ZipOutputStream(OutputStream outputStream) throws IOException {
this(outputStream, null, null);
Expand Down Expand Up @@ -126,7 +126,6 @@ public FileHeader closeEntry() throws IOException {
public void close() throws IOException {
if (!this.entryClosed) {
closeEntry();
this.entryClosed = true;
}

zipModel.getEndOfCentralDirectoryRecord().setOffsetOfStartOfCentralDirectory(countingOutputStream.getNumberOfBytesWritten());
Expand Down

0 comments on commit a0b9dee

Please sign in to comment.