Skip to content

ZipOuputStream does not support writing custom entries #682

Closed

Description

@Temtaime

Steps to reproduce

  1. Create ZipEntry and set Crc, CompressedSize, Size and CompressionMethod(Deflate).
  2. Try to write deflated stream to zip.

Expected behavior

Archive is created from compressed data.

Actual behavior

There are plently of checks for crc/size/compressed size and many of them are wrong for such a case, also library tries to compress futher compressed stream.

Version of SharpZipLib

Latest

Activity

  1. Temtaime commented on Oct 28, 2021

    @Temtaime
    Author

    I'll try to propose a PR in days, seems there's not so much to fix

  2. added a commit that references this issue on Nov 2, 2021
    bc49979
  3. changed the title [-]Enable ZipOuputStream to write precompressed files[/-] [+]ZipOuputStream does not support writing custom entries[/+] on Nov 2, 2021
  4. piksel commented on Nov 2, 2021

    @piksel
    Member

    This is not how ZipOutputStream is designed to work. Do you have a specific use case?
    Adding a new state and custom logic for this adds to the complexity and maintenance cost, and would need to be fully covered by tests...

  5. Temtaime commented on Nov 2, 2021

    @Temtaime
    Author

    Ok, i'll add some tests.
    It can be used to serve files from webserver that are stored already precompressed to avoid CPU resources on compression

  6. piksel commented on Nov 2, 2021

    @piksel
    Member

    Okay, so for combining a variable set of files into a single download by creating a ZIP archive on-the-fly?

  7. Temtaime commented on Nov 2, 2021

    @Temtaime
    Author

    Exactly, i was using my own solution, but found this library with rich functional and figured out that adding this possibility into existing codebase should not be a problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions