Documentation
¶
Overview ¶
Package ziputil writes zip entries without recompressing them, for generators that stream an archive built from another one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyData ¶
CopyData copies f's raw data to w, checking ctx between chunks. A source that ends before the data does is an error rather than a short entry.
func CopyRawWith ¶
CopyRawWith creates f's entry in zw with RawHeader and has body write its raw data, unless it is a directory. Measuring an archive passes a body that writes placeholder bytes, so the measured size comes from the same code as the real write.
func RawHeader ¶
func RawHeader(f *zip.File) *zip.FileHeader
RawHeader returns a header for copying f with zip.Writer.CreateRaw. The sizes and CRC go in the local header, so no data descriptor follows the data, and the source's ZIP64 extra field is dropped: it describes the source's offsets, and the writer adds its own when the output needs one. A directory becomes an empty stored entry, since the writer takes no data for one; some tools deflate a directory's empty body.