MCPcopy
hub / github.com/rs/zerolog / AppendInts32

Method AppendInts32

internal/cbor/types.go:172–188  ·  view source on GitHub ↗

AppendInts32 encodes and inserts an array of int32 values into the dst byte array.

(dst []byte, vals []int32)

Source from the content-addressed store, hash-verified

170
171// AppendInts32 encodes and inserts an array of int32 values into the dst byte array.
172func (e Encoder) AppendInts32(dst []byte, vals []int32) []byte {
173 major := majorTypeArray
174 l := len(vals)
175 if l == 0 {
176 return e.AppendArrayEnd(e.AppendArrayStart(dst))
177 }
178 if l <= additionalMax {
179 lb := byte(l)
180 dst = append(dst, major|lb)
181 } else {
182 dst = appendCborTypePrefix(dst, major, uint64(l))
183 }
184 for _, v := range vals {
185 dst = e.AppendInt(dst, int(v))
186 }
187 return dst
188}
189
190// AppendInt64 encodes and inserts a int64 value into the dst byte array.
191func (Encoder) AppendInt64(dst []byte, val int64) []byte {

Callers

nothing calls this directly

Calls 4

AppendArrayEndMethod · 0.95
AppendArrayStartMethod · 0.95
AppendIntMethod · 0.95
appendCborTypePrefixFunction · 0.85

Tested by

no test coverage detected