bpool

package
v0.0.0-...-6a57f2c Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package bpool implements a fixed size pool of byte slices.

Index

Constants

This section is empty.

Variables

View Source
var ErrBpoolNoFree = errors.New("no free byte slice in pool")

ErrBpoolNoFree - Normally this error should never be returned, this error indicates a bug in the package consumer.

Functions

This section is empty.

Types

type BytePool

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

BytePool - temporary pool of byte slices.

func NewBytePool

func NewBytePool(size int64, n int) *BytePool

NewBytePool - Returns new pool. size - length of each slice. n - number of slices in the pool.

func (*BytePool) Get

func (b *BytePool) Get() (buf []byte, err error)

Get - Returns an unused byte slice.

func (*BytePool) Reset

func (b *BytePool) Reset()

Reset - Marks all slices as unused.

Jump to

Keyboard shortcuts

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