(p []byte)
| 124 | } |
| 125 | |
| 126 | func (r *flateReadWrapper) Read(p []byte) (int, error) { |
| 127 | if r.fr == nil { |
| 128 | return 0, io.ErrClosedPipe |
| 129 | } |
| 130 | n, err := r.fr.Read(p) |
| 131 | if err == io.EOF { |
| 132 | // Preemptively place the reader back in the pool. This helps with |
| 133 | // scenarios where the application does not call NextReader() soon after |
| 134 | // this final read. |
| 135 | r.Close() |
| 136 | } |
| 137 | return n, err |
| 138 | } |
| 139 | |
| 140 | func (r *flateReadWrapper) Close() error { |
| 141 | if r.fr == nil { |