pool

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBufReader added in v0.12.2

func GetBufReader(r io.Reader) *bufio.Reader

GetBufReader returns a *bufio.Reader from pool.

func GetBuffer

func GetBuffer(size int) []byte

GetBuffer gets a buffer from pool, size should in range: [1, 65536], otherwise, this function will call make([]byte, size) directly.

func GetBytesBuffer added in v0.12.2

func GetBytesBuffer() *bytes.Buffer

GetBytesBuffer returns a bytes.buffer from pool.

func PutBufReader added in v0.12.2

func PutBufReader(br *bufio.Reader)

PutBufReader puts a *bufio.Reader into pool.

func PutBuffer

func PutBuffer(buf []byte)

PutBuffer puts a buffer into pool.

func PutBytesBuffer added in v0.12.2

func PutBytesBuffer(buf *bytes.Buffer)

PutBytesBuffer puts a bytes.buffer into pool.

Types

This section is empty.

Jump to

Keyboard shortcuts

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