Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
BufferPool is a bucketed pool for variably bytes buffers.
func NewBuffer ¶
func NewBuffer(minSize, maxSize int, factor float64) *BufferPool
NewBuffer a new Pool with size buckets for minSize to maxSize increasing by the given factor.
func (*BufferPool) Get ¶
func (p *BufferPool) Get(sz int) *bytes.Buffer
Get returns a byte buffer that fits the given size.
func (*BufferPool) Put ¶
func (p *BufferPool) Put(s *bytes.Buffer)
Put adds a byte buffer to the right bucket in the pool.
Click to show internal directories.
Click to hide internal directories.