Documentation ¶
Index ¶
- Variables
- func NewPool(minSize int) *bufferPool
- type Buffer
- func (bb *Buffer) Append(b []byte)
- func (bb *Buffer) Head(n int) ([]byte, error)
- func (bb *Buffer) Len() int
- func (bb *Buffer) OnRelease(onRelease func(b []byte))
- func (bb *Buffer) Pop(n int) ([]byte, error)
- func (bb *Buffer) Push(b []byte)
- func (bb *Buffer) Read(n int) ([]byte, error)
- func (bb *Buffer) ReadAll() ([]byte, error)
- func (bb *Buffer) Reset()
- func (bb *Buffer) Sub(from, to int) ([]byte, error)
- func (bb *Buffer) Write(b []byte)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLength = errors.New("invalid length") ErrInvalidPosition = errors.New("invalid position") ErrNotEnougth = errors.New("bytes not enougth") )
Pool is the default instance of []byte pool. User can customize a Pool implementation and reset this instance if needed.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.