MCPcopy
hub / github.com/golang/protobuf / SetBuf

Method SetBuf

proto/buffer.go:87–90  ·  view source on GitHub ↗

SetBuf sets buf as the internal buffer, where the contents of buf are considered the unread portion of the buffer.

(buf []byte)

Source from the content-addressed store, hash-verified

85// SetBuf sets buf as the internal buffer,
86// where the contents of buf are considered the unread portion of the buffer.
87func (b *Buffer) SetBuf(buf []byte) {
88 b.buf = buf
89 b.idx = 0
90}
91
92// Reset clears the internal buffer of all written and unread data.
93func (b *Buffer) Reset() {

Callers 2

TestBufferMarshalAllocsFunction · 0.95

Calls

no outgoing calls

Tested by 2

TestBufferMarshalAllocsFunction · 0.76