xbytes

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	KB = 1000 * B
	MB = 1000 * KB
	GB = 1000 * MB
	TB = 1000 * GB
)
View Source
const (
	KiB = 1024 * B
	MiB = 1024 * KiB
	GiB = 1024 * MiB
	TiB = 1024 * GiB
)
View Source
const B int64 = 1

Variables

This section is empty.

Functions

func GetBuffer

func GetBuffer(cap int64) []byte

GetBuffer returns a buffer with empty length and given cap from pool.

func GetBytes

func GetBytes(size int64) []byte

GetBytes returns a byte slice from pool.

func GetMostUsedBuffer

func GetMostUsedBuffer() []byte

func PutBuffer

func PutBuffer(buf []byte)

PutBuffer resets the underlying of the buffer and adds it to the pool for future reuses.

func PutBytes

func PutBytes(buf []byte)

PutBytes adds the byte slice to the pool for future reuses.

Types

This section is empty.

Jump to

Keyboard shortcuts

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