Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteSlicesPool ¶
type ByteSlicesPool struct {
// contains filtered or unexported fields
}
ByteSlicesPool is a pool for byte-slices reuse.
func NewByteSlicesPool ¶
func NewByteSlicesPool(initialCap int) *ByteSlicesPool
NewByteSlicesPool create a new ByteSlicesPool instance. initialCap defines the cap value of new []byte.
func (*ByteSlicesPool) Get ¶
func (p *ByteSlicesPool) Get() *[]byte
Get a []byte with 0 length and unfixed cap.
func (*ByteSlicesPool) GetWithLen ¶
func (p *ByteSlicesPool) GetWithLen(l int) *[]byte
GetWithLen return a []byte with the designated length and unfixed cap.
func (*ByteSlicesPool) Put ¶
func (p *ByteSlicesPool) Put(n *[]byte)
Put a []byte into pool. The slice will be reset to 0 length and its cap will not change.
Click to show internal directories.
Click to hide internal directories.