pool

package
v0.0.0-...-d00ae73 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

View Source
const BufferSize = 4096
View Source
const UDP_MAX_PACKET_SIZE = 64 * 1204

Variables

This section is empty.

Functions

func GetBuf

func GetBuf() []byte
Example
buf := GetBuf()
fmt.Printf("len: %v\n", len(buf))
fmt.Printf("cap: %v\n", cap(buf))

buf2 := buf[1024:]
fmt.Printf("len: %v\n", len(buf2))
fmt.Printf("cap: %v\n", cap(buf2))

bufReader := bytes.NewBuffer(buf2)
bufReader.Reset()
fmt.Println(bufReader.Len())
fmt.Printf("len: %v\n", len(buf2))
fmt.Printf("cap: %v\n", cap(buf2))
Output:

len: 4096
cap: 4096
len: 3072
cap: 3072

func GetBufBySize

func GetBufBySize(size int) []byte

func PutBuf

func PutBuf(buf []byte)

Types

This section is empty.

Jump to

Keyboard shortcuts

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