Lines Matching refs:fh
197 func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error) {
198 fh.Flags |= DataDescriptorFlag // writing a data descriptor
199 return w.createHeaderImpl(fh)
213 func (w *Writer) createHeaderImpl(fh *FileHeader) (io.Writer, error) {
220 if len(w.dir) > 0 && w.dir[len(w.dir)-1].FileHeader == fh {
227 fh.CreatorVersion = fh.CreatorVersion&0xff00 | zipVersion20 // preserve compatibility byte
228 fh.ReaderVersion = zipVersion20
235 comp := w.compressor(fh.Method)
247 FileHeader: fh,
253 if err := writeHeader(w.cw, fh); err != nil {
356 fh := w.header.FileHeader
357 fh.CRC32 = w.crc32.Sum32()
358 fh.CompressedSize64 = uint64(w.compCount.count)
359 fh.UncompressedSize64 = uint64(w.rawCount.count)
361 if fh.isZip64() {
362 fh.CompressedSize = uint32max
363 fh.UncompressedSize = uint32max
364 fh.ReaderVersion = zipVersion45 // requires 4.5 - File uses ZIP64 format extensions
366 fh.CompressedSize = uint32(fh.CompressedSize64)
367 fh.UncompressedSize = uint32(fh.UncompressedSize64)
371 if fh.Flags&DataDescriptorFlag != 0 {
378 if fh.isZip64() {
385 b.uint32(fh.CRC32)
386 if fh.isZip64() {
387 b.uint64(fh.CompressedSize64)
388 b.uint64(fh.UncompressedSize64)
390 b.uint32(fh.CompressedSize)
391 b.uint32(fh.UncompressedSize)