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 ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.