buf

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: BSD-3-Clause Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bytes

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

func FromBytes

func FromBytes(in []byte) *Bytes

func Get

func Get(n, c int) *Bytes

func GetCap

func GetCap(c int) *Bytes

func GetLen

func GetLen(n int) *Bytes

func (*Bytes) AppendByte

func (bb *Bytes) AppendByte(b byte)

func (*Bytes) AppendFrom

func (bb *Bytes) AppendFrom(data []byte)

func (*Bytes) AppendString

func (bb *Bytes) AppendString(s string)

func (*Bytes) AppendTo

func (bb *Bytes) AppendTo(data []byte) []byte

func (*Bytes) Bytes

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

func (Bytes) Cap

func (bb Bytes) Cap() int

func (*Bytes) CopyFrom

func (bb *Bytes) CopyFrom(data []byte)

func (*Bytes) CopyFromWithOffset

func (bb *Bytes) CopyFromWithOffset(data []byte, offset int)

func (*Bytes) CopyTo

func (bb *Bytes) CopyTo(data []byte) []byte

func (*Bytes) Fill

func (bb *Bytes) Fill(data []byte, start, end int)

func (*Bytes) Len

func (bb *Bytes) Len() int

func (*Bytes) Read

func (bb *Bytes) Read(p []byte) (n int, err error)

func (*Bytes) Release

func (bb *Bytes) Release()

func (*Bytes) Reset

func (bb *Bytes) Reset()

func (*Bytes) SetBytes

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

func (*Bytes) Write

func (bb *Bytes) Write(p []byte) (n int, err error)

type BytesPool added in v0.9.27

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

BytesPool contains the logic of reusing objects distinguishable by size in generic way.

func NewBytesPool

func NewBytesPool(min, max int) *BytesPool

NewBytesPool creates new BytesPool that reuses objects which size is in logarithmic range [min, max].

func (*BytesPool) Get added in v0.9.27

func (p *BytesPool) Get(n, c int) *Bytes

Get returns probably reused slice of bytes with at least capacity of c and exactly len of n.

func (*BytesPool) GetCap added in v0.9.27

func (p *BytesPool) GetCap(c int) *Bytes

GetCap returns probably reused slice of bytes with at least capacity of n.

func (*BytesPool) GetLen added in v0.9.27

func (p *BytesPool) GetLen(n int) *Bytes

GetLen returns probably reused slice of bytes with at least capacity of n and exactly len of n.

Jump to

Keyboard shortcuts

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