Lines Matching refs:w
25 func (w *Writer) CopyFrom(orig *File, newName string) error {
26 if w.last != nil && !w.last.closed {
27 if err := w.last.close(); err != nil {
30 w.last = nil
43 offset: uint64(w.cw.count),
45 w.dir = append(w.dir, h)
56 if err := writeHeader(w.cw, fh); err != nil {
63 io.Copy(w.cw, io.NewSectionReader(orig.zipr, dataOffset, int64(orig.CompressedSize64)))
83 _, err = w.cw.Write(buf)
131 func (w *Writer) CreateCompressedHeader(fh *FileHeader) (io.WriteCloser, error) {
132 if w.last != nil && !w.last.closed {
133 if err := w.last.close(); err != nil {
137 if len(w.dir) > 0 && w.dir[len(w.dir)-1].FileHeader == fh {
149 zipw: w.cw,
150 compCount: &countWriter{w: w.cw},
156 offset: uint64(w.cw.count),
158 w.dir = append(w.dir, h)
161 if err := writeHeader(w.cw, fh); err != nil {
165 w.last = &fw.fileWriter
170 func (w *Writer) CreateHeaderAndroid(fh *FileHeader) (io.Writer, error) {
177 return w.createHeaderImpl(fh)
184 func (w *compressedFileWriter) Write(p []byte) (int, error) {
185 if w.closed {
188 return w.compCount.Write(p)
191 func (w *compressedFileWriter) Close() error {
192 if w.closed {
195 w.closed = true
198 fh := w.header.FileHeader
199 fh.CompressedSize64 = uint64(w.compCount.count)
231 _, err := w.zipw.Write(buf)