MCPcopy Create free account
hub / github.com/brimdata/super / encodeArrayBytes

Method encodeArrayBytes

sup/marshal.go:453–462  ·  view source on GitHub ↗
(arrayVal reflect.Value)

Source from the content-addressed store, hash-verified

451}
452
453func (m *MarshalBSUPContext) encodeArrayBytes(arrayVal reflect.Value) (super.Type, error) {
454 n := arrayVal.Len()
455 bytes := make([]byte, 0, n)
456 for k := range n {
457 v := arrayVal.Index(k)
458 bytes = append(bytes, v.Interface().(uint8))
459 }
460 m.Builder.Append(bytes)
461 return super.TypeBytes, nil
462}
463
464func (m *MarshalBSUPContext) encodeArray(arrayVal reflect.Value) (super.Type, error) {
465 m.Builder.BeginContainer()

Callers 1

encodeAnyMethod · 0.95

Calls 3

IndexMethod · 0.80
LenMethod · 0.65
AppendMethod · 0.45

Tested by

no test coverage detected