New creates a Buffer with 0 length and 2K capacity.
()
| 198 | |
| 199 | // New creates a Buffer with 0 length and 2K capacity. |
| 200 | func New() *Buffer { |
| 201 | return &Buffer{ |
| 202 | v: pool.Get().([]byte), |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | // StackNew creates a new Buffer object on stack. |
| 207 | // This method is for buffers that is released in the same function. |