buffer

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Put

func Put(b *Bytes)

Types

type Bytes

type Bytes struct {
	B []byte
}

Bytes is a simple buffer. It is unsafe, SHOULD not modify existing bytes.

func Get

func Get() *Bytes

func (*Bytes) Bytes

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

func (*Bytes) Cap

func (bs *Bytes) Cap() int

func (*Bytes) EnsureRemaining

func (bs *Bytes) EnsureRemaining(atLeast int)

EnsureRemaining ensures the buffer has space for at least `atLeast` additional bytes beyond the current length (i.e., remaining capacity). It grows the buffer if necessary using an amortized growth strategy.

func (*Bytes) Len

func (bs *Bytes) Len() int

func (*Bytes) Remaining

func (bs *Bytes) Remaining() int

func (*Bytes) Reset

func (bs *Bytes) Reset()

func (*Bytes) String

func (bs *Bytes) String() string

func (*Bytes) Write

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

func (*Bytes) WriteString

func (bs *Bytes) WriteString(s string) (n int, err error)

Unsafe!!!

Jump to

Keyboard shortcuts

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