bytepool

package
v2.0.0-rc.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2017 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytePool

type BytePool struct {
	sync.Pool
}

BytePool is a cached pool of reusable byte slices.

func New

func New(length int) *BytePool

New allocates a new BytePool with slices of equal length and capacity.

func (*BytePool) Get

func (bp *BytePool) Get() []byte

Get returns a byte slice from the pool.

func (*BytePool) Put

func (bp *BytePool) Put(b []byte)

Put returns a byte slice to the pool.

Jump to

Keyboard shortcuts

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