srikanth-lingala / zip4j

A Java library for zip files and streams
Apache License 2.0
2.06k stars 310 forks source link

Replacing the file in the zip makes the position of the file move to the bottom of the list #470

Closed AozoraDev closed 2 years ago

AozoraDev commented 2 years ago

Hey hay! So, I used .addFile() to replace a file into a zip.

But after the process is complete and I refresh the FileHeaders list, the file position moves to the bottom. IMG_20220826_164400

srikanth-lingala commented 2 years ago

Yeah, when an entry in a zip file is replaced, it basically removes that entry from that position in the zip file, and appends it to the end of the zip file. Zip4j cannot override in the existing location of the entry because the size of the entry might change.

AozoraDev commented 2 years ago

Oh okay. Thanks!