bytepool

package
v1.3.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Pool16k = NewPool(16 << 10)
View Source
var Pool1k = NewPool(1 << 10)
View Source
var Pool32k = NewPool(32 << 10)
View Source
var Pool4k = NewPool(4 << 10)

Functions

This section is empty.

Types

type Buf

type Buf struct {
	Bytes []byte
}

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

Pool for get byte slice

func NewPool

func NewPool(length int) *Pool

NewPool 创建新对象

func (*Pool) Get

func (this *Pool) Get() *Buf

Get 获取一个新的byte slice

func (*Pool) Length

func (this *Pool) Length() int

Length 单个字节slice长度

func (*Pool) Put

func (this *Pool) Put(ptr *Buf)

Put 放回一个使用过的byte slice

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL