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

Method EncodeMessage

proto/buffer.go:181–186  ·  view source on GitHub ↗

EncodeMessage appends a length-prefixed encoded message to the buffer.

(m Message)

Source from the content-addressed store, hash-verified

179
180// EncodeMessage appends a length-prefixed encoded message to the buffer.
181func (b *Buffer) EncodeMessage(m Message) error {
182 var err error
183 b.buf = protowire.AppendVarint(b.buf, uint64(Size(m)))
184 b.buf, err = marshalAppend(b.buf, m, b.deterministic)
185 return err
186}
187
188// DecodeVarint consumes an encoded unsigned varint from the buffer.
189func (b *Buffer) DecodeVarint() (uint64, error) {

Callers

nothing calls this directly

Calls 2

SizeFunction · 0.85
marshalAppendFunction · 0.85

Tested by

no test coverage detected