Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
MaxBytesLimit = errors.New("Max bytes limit of bytebufffer")
)
Functions ¶
func Bytes2String ¶ added in v1.0.35
Byte2String []byte -> string
func Get ¶ added in v1.0.32
func Get() *byteBuffer
Get returns an empty byte buffer from the pool.
Got byte buffer may be returned to the pool via Put call. This reduces the number of memory allocations required for byte buffer management.
func NewByteBuffer ¶ added in v1.0.35
func NewLoopQueue ¶
func Put ¶ added in v1.0.32
func Put(b *byteBuffer)
Put returns byte buffer to the pool.
byteBuffer.B mustn't be touched after returning it to the pool. Otherwise, data races will occur.
func String2Bytes ¶ added in v1.0.35
String2Bytes string -> []byte
Types ¶
type Pool ¶ added in v1.0.32
type Pool struct {
DefaultSize uint64
BufferMaxSize uint
// contains filtered or unexported fields
}
Pool represents byte buffer pool.
Distinct pools may be used for distinct types of byte buffers. Properly determined byte buffer types with their own pools may help reducing memory waste.
Click to show internal directories.
Click to hide internal directories.