Initial QSfera import

This commit is contained in:
Курнат Андрей
2026-06-07 10:20:04 +03:00
commit 2315f25754
16485 changed files with 4826827 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
package strutil
import (
"github.com/gookit/goutil/byteutil"
)
// Buffer wrap and extends the bytes.Buffer
type Buffer = byteutil.Buffer
// NewBuffer instance, can set init size
func NewBuffer(initSize ...int) *Buffer {
if len(initSize) > 0 && initSize[0] > 0 {
buf := &Buffer{}
buf.Grow(initSize[0])
return buf
}
return &Buffer{}
}
// ByteChanPool struct
//
// Usage:
//
// bp := strutil.NewByteChanPool(500, 1024, 1024)
// buf:=bp.Get()
// defer bp.Put(buf)
// // use buf do something ...
type ByteChanPool = byteutil.ChanPool
// NewByteChanPool instance
func NewByteChanPool(maxSize, width, capWidth int) *ByteChanPool {
return byteutil.NewChanPool(maxSize, width, capWidth)
}