MCPcopy Index your code
hub / github.com/CrowdStrike/csproto / EncodeBytes

Method EncodeBytes

encoder.go:42–47  ·  view source on GitHub ↗

EncodeBytes writes a length-delimited byte slice to the buffer preceded by the varint-encoded tag key.

(tag int, v []byte)

Source from the content-addressed store, hash-verified

40
41// EncodeBytes writes a length-delimited byte slice to the buffer preceded by the varint-encoded tag key.
42func (e *Encoder) EncodeBytes(tag int, v []byte) {
43 e.offset += EncodeTag(e.p[e.offset:], tag, WireTypeLengthDelimited)
44 e.offset += EncodeVarint(e.p[e.offset:], uint64(len(v)))
45 copy(e.p[e.offset:], v)
46 e.offset += len(v)
47}
48
49// EncodeUInt32 writes a varint-encoded 32-bit unsigned integer value to the buffer preceded by the varint-encoded tag key.
50func (e *Encoder) EncodeUInt32(tag int, v uint32) {

Callers 15

EncodeStringMethod · 0.95
TestEncodeBytesFunction · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80

Calls 2

EncodeTagFunction · 0.85
EncodeVarintFunction · 0.85

Tested by 1

TestEncodeBytesFunction · 0.64