pool

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: GPL-3.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBufReader

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

func GetBytesBuffer() *bytes.Buffer

GetBytesBuffer returns a bytes.buffer from pool.

func PutBufReader

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

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