pool

package
v0.3.1-rc.6 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSize = 16 * 0x400

Variables

This section is empty.

Functions

func GetBuffer

func GetBuffer() *bytes.Buffer

func GetBytes

func GetBytes[T constraints.Integer](size T) []byte

func PutBuffer

func PutBuffer(b *bytes.Buffer)

func PutBytes

func PutBytes(b []byte)

func PutBytesV2

func PutBytesV2(b *Bytes)

Types

type Bytes

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

func GetBytesV2

func GetBytesV2[T constraints.Integer](size T) *Bytes

func (*Bytes) After

func (b *Bytes) After(index int) []byte

func (*Bytes) Bytes

func (b *Bytes) Bytes() []byte

type Pool

type Pool interface {
	GetBytes(size int) []byte
	PutBytes(b []byte)

	GetBuffer() *bytes.Buffer
	PutBuffer(b *bytes.Buffer)
}
var DefaultPool Pool = &pool{}

Jump to

Keyboard shortcuts

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