MCPcopy
hub / github.com/vmihailenco/msgpack / EncodeArrayLen

Method EncodeArrayLen

encode_slice.go:91–99  ·  view source on GitHub ↗
(l int)

Source from the content-addressed store, hash-verified

89}
90
91func (e *Encoder) EncodeArrayLen(l int) error {
92 if l < 16 {
93 return e.writeCode(msgpcode.FixedArrayLow | byte(l))
94 }
95 if l <= math.MaxUint16 {
96 return e.write2(msgpcode.Array16, uint16(l))
97 }
98 return e.write4(msgpcode.Array32, uint32(l))
99}
100
101func encodeStringSliceValue(e *Encoder, v reflect.Value) error {
102 ss := v.Convert(stringSliceType).Interface().([]string)

Callers 3

encodeStringSliceMethod · 0.95
encodeStructValueAsArrayFunction · 0.80
encodeArrayValueFunction · 0.80

Calls 3

writeCodeMethod · 0.95
write2Method · 0.95
write4Method · 0.95

Tested by

no test coverage detected