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

Method readCountedString

sio/bsupio/types.go:388–399  ·  view source on GitHub ↗
(b *buffer)

Source from the content-addressed store, hash-verified

386}
387
388func (d *Decoder) readCountedString(b *buffer) (string, error) {
389 n, err := readUvarintAsInt(b)
390 if err != nil {
391 return "", errBadFormat
392 }
393 name, err := b.read(n)
394 if err != nil {
395 return "", errBadFormat
396 }
397 // pull the name out before the next read which might overwrite the buffer
398 return string(name), nil
399}
400
401func (d *Decoder) readTypeName(b *buffer) error {
402 name, err := d.readCountedString(b)

Callers 3

readFieldMethod · 0.95
readTypeEnumMethod · 0.95
readTypeNameMethod · 0.95

Calls 2

readUvarintAsIntFunction · 0.85
readMethod · 0.45

Tested by

no test coverage detected