MCPcopy Create free account
hub / github.com/valyala/bytebufferpool / ExampleByteBuffer

Function ExampleByteBuffer

bytebuffer_example_test.go:9–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7)
8
9func ExampleByteBuffer() {
10 bb := bytebufferpool.Get()
11
12 bb.WriteString("first line\n")
13 bb.Write([]byte("second line\n"))
14 bb.B = append(bb.B, "third line\n"...)
15
16 fmt.Printf("bytebuffer contents=%q", bb.B)
17
18 // It is safe to release byte buffer now, since it is
19 // no longer used.
20 bytebufferpool.Put(bb)
21}

Callers

nothing calls this directly

Calls 4

GetMethod · 0.80
WriteStringMethod · 0.80
WriteMethod · 0.80
PutMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…