()
| 21 | } |
| 22 | |
| 23 | func newCompressor() *compressor { |
| 24 | c := &compressor{} |
| 25 | c.readersPool = sync.Pool{ |
| 26 | New: func() interface{} { |
| 27 | return snappy.NewReader(nil) |
| 28 | }, |
| 29 | } |
| 30 | c.writersPool = sync.Pool{ |
| 31 | New: func() interface{} { |
| 32 | return snappy.NewBufferedWriter(nil) |
| 33 | }, |
| 34 | } |
| 35 | return c |
| 36 | } |
| 37 | |
| 38 | func (c *compressor) Name() string { |
| 39 | return Name |
no outgoing calls