Documentation ¶
Overview ¶
Package bufpool is a freelist for bytes.Buffer objects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyBytes ¶
CopyBytes returns a copy of the bytes contained in the buffer. This slice is safe from updates in the underlying buffer, allowing the buffer to be placed back in the free list.
func Get ¶
Get returns an initialized bytes.Buffer object. It is like new(bytes.Buffer) except it uses the free list. The caller should call Put when finished with the returned object. Since Buffer.Bytes() returns the buffer's underlying slice, it is not safe for that slice to escape the caller. If the bytes need to escape, CopyBytes should be used.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.