You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compress first and include later based on whether the compressed size was smaller than the original, without having to perform the compression twice.
Support concurrent compression: compress many files concurrently and then copy the already compressed files to the archive (similar to Apache Commons Compress' ParallelScatterZipCreator)
I see three different ways we could achieve this:
Create a zip.CreateHeaderRaw(fh *FileHeader) (io.Writer, error) function, that uses the FileHeader's CRC32 and UncompressedSize64 fields set by the user.
Use the existing CreateHeader(fh *FileHeader) (io.Writer, error) function, but have a new FileHeader field that indicates we're going to write already compressed data (and then use CRC32 and UncompressedSize64 fields set by the user)
Use the existing CreateHeader(fh *FileHeader) (io.Writer, error) function, but if CompressedSize64 has already been set, assume that data written is already compressed.
I'm going to assume that option 3 would be a no-go, because existing code might suddenly break if a user has already set the CompressedSize for whatever reason, but hopefully the other options are viable.
If you have a compressed file, know its uncompressed size and crc32 checksum, it'd be nice to be able to add it to an archive as is.
I have three current use-cases for this:
I see three different ways we could achieve this:
zip.CreateHeaderRaw(fh *FileHeader) (io.Writer, error)function, that uses the FileHeader'sCRC32andUncompressedSize64fields set by the user.CreateHeader(fh *FileHeader) (io.Writer, error)function, but have a new FileHeader field that indicates we're going to write already compressed data (and then useCRC32andUncompressedSize64fields set by the user)CreateHeader(fh *FileHeader) (io.Writer, error)function, but ifCompressedSize64has already been set, assume that data written is already compressed.I'm going to assume that option 3 would be a no-go, because existing code might suddenly break if a user has already set the CompressedSize for whatever reason, but hopefully the other options are viable.