bufpool

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufPool

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

BufPool maintains a buffer pool.

func New

func New() *BufPool

New creates a new BufPool.

func (*BufPool) Get

func (p *BufPool) Get() *bytes.Buffer

Get returns an empty buffer from the pool. It creates a new buffer, if there is no bytes.Buffer available in the pool.

func (*BufPool) Put

func (p *BufPool) Put(b *bytes.Buffer)

Put resets the buffer and puts it back to the pool.

Jump to

Keyboard shortcuts

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