MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / Get

Method Get

internal/utils/buffer_pool.go:29–35  ·  view source on GitHub ↗

Get 获取一个新的Buffer

()

Source from the content-addressed store, hash-verified

27
28// Get 获取一个新的Buffer
29func (this *BufferPool) Get() (b *bytes.Buffer) {
30 var buffer = this.rawPool.Get().(*bytes.Buffer)
31 if buffer.Len() > 0 {
32 buffer.Reset()
33 }
34 return buffer
35}
36
37// Put 放回一个使用过的byte slice
38func (this *BufferPool) Put(b *bytes.Buffer) {

Callers

nothing calls this directly

Calls 2

ResetMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected