func (c *Client) Get() *bytes.Buffer {
	b := <-c.p.ch
	b.Reset()
	c.sent <- b
	return b
}
Get returns a buffer from the shared buffer pool.
package hci
import (
	"bytes"
	"fmt"
	"sync"
)
type Pool struct {
	sync.Mutex
	sz  int
	cnt int
	ch  chan *bytes.Buffer
}
func NewPool(sz int, cnt int) (*Pool, error) {
	if cnt == 0 {
		return nil, fmt.Errorf("invalid buffer size")
	}
	ch := make(chan *bytes.Buffer, cnt)
	for len(ch) < cnt {
		ch <- bytes.NewBuffer(make([]byte, sz))
	}
	return &Pool{sz: sz, cnt: cnt, ch: ch}, nil
}
type Client struct {
	p    *Pool
	sent chan *bytes.Buffer
}
func NewClient(p *Pool) *Client {
	return &Client{p: p, sent: make(chan *bytes.Buffer, p.cnt)}
}
func (c *Client) LockPool() {
	c.p.Lock()
}
func (c *Client) UnlockPool() {
	c.p.Unlock()
}