Documentation ¶
Index ¶
Constants ¶
View Source
const ( HeaderBufferPoolSize = 8192 RepairBufferPollSize = 256 )
Variables ¶
This section is empty.
Functions ¶
func NewTinyBufferPool ¶
Types ¶
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
BufferPool defines the struct of a buffered pool with 4 objects.
func NewBufferPool ¶
func NewBufferPool() (bufferP *BufferPool)
NewBufferPool returns a new buffered pool.
func (*BufferPool) Get ¶
func (bufferP *BufferPool) Get(size int) (data []byte, err error)
Get returns the data based on the given size. Different size corresponds to different object in the pool.
func (*BufferPool) Put ¶
func (bufferP *BufferPool) Put(data []byte)
Put puts the given data into the buffer pool.
Click to show internal directories.
Click to hide internal directories.