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

Method AppendUints8

internal/cbor/types.go:256–272  ·  view source on GitHub ↗

AppendUints8 encodes and inserts an array of uint8 values into the dst byte array.

(dst []byte, vals []uint8)

Source from the content-addressed store, hash-verified

254
255// AppendUints8 encodes and inserts an array of uint8 values into the dst byte array.
256func (e Encoder) AppendUints8(dst []byte, vals []uint8) []byte {
257 major := majorTypeArray
258 l := len(vals)
259 if l == 0 {
260 return e.AppendArrayEnd(e.AppendArrayStart(dst))
261 }
262 if l <= additionalMax {
263 lb := byte(l)
264 dst = append(dst, major|lb)
265 } else {
266 dst = appendCborTypePrefix(dst, major, uint64(l))
267 }
268 for _, v := range vals {
269 dst = e.AppendUint8(dst, v)
270 }
271 return dst
272}
273
274// AppendUint16 encodes and inserts a uint16 value into the dst byte array.
275func (e Encoder) AppendUint16(dst []byte, val uint16) []byte {

Callers

nothing calls this directly

Calls 4

AppendArrayEndMethod · 0.95
AppendArrayStartMethod · 0.95
AppendUint8Method · 0.95
appendCborTypePrefixFunction · 0.85

Tested by

no test coverage detected