Lines Matching refs:w
20 type Compressor func(w io.Writer) (io.WriteCloser, error)
31 func newFlateWriter(w io.Writer) io.WriteCloser {
34 fw.Reset(w)
36 fw, _ = flate.NewWriter(w, 5)
46 func (w *pooledFlateWriter) Write(p []byte) (n int, err error) {
47 w.mu.Lock()
48 defer w.mu.Unlock()
49 if w.fw == nil {
52 return w.fw.Write(p)
55 func (w *pooledFlateWriter) Close() error {
56 w.mu.Lock()
57 defer w.mu.Unlock()
59 if w.fw != nil {
60 err = w.fw.Close()
61 flateWriterPool.Put(w.fw)
62 w.fw = nil
109 Store: func(w io.Writer) (io.WriteCloser, error) { return &nopCloser{w}, nil },
110 Deflate: func(w io.Writer) (io.WriteCloser, error) { return newFlateWriter(w), nil },