v.23.12Improvement

Added finalize() function to ZipArchiveWriter and simplified code, addressing issue #58074.

Added explicit finalize() function in ZipArchiveWriter. Simplify too complicated code in ZipArchiveWriter. This fixes #58074. #58202 (Vitaly Baranov).
Introduced an explicit finalize() function in ZipArchiveWriter to simplify and improve the clarity of the archive writing process.

Why it matters

The addition of the finalize() function addresses overly complicated code in ZipArchiveWriter, making it easier to maintain and fix issues related to archive finalization, as exemplified by the resolution of issue #58074.

How to use it

Users benefit from this change internally during the creation of ZIP archives as the new finalize() method is automatically called to properly complete the archive writing process without requiring direct interaction.