MCPcopy Create free account
hub / github.com/IBM/sarama / getArrayLength

Method getArrayLength

real_decoder.go:402–418  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

400}
401
402func (rd *realFlexibleDecoder) getArrayLength() (int, error) {
403 n, err := rd.getUVarint()
404 if err != nil {
405 return 0, err
406 }
407
408 if n == 0 {
409 return 0, nil
410 }
411
412 if n-1 > uint64(rd.remaining()) {
413 rd.off = len(rd.raw)
414 return 0, ErrInsufficientData
415 }
416
417 return int(n - 1), nil
418}
419
420func (rd *realFlexibleDecoder) getEmptyTaggedFieldArray() (int, error) {
421 tagCount, err := rd.getUVarint()

Callers 1

getStringArrayMethod · 0.95

Calls 2

getUVarintMethod · 0.65
remainingMethod · 0.65

Tested by

no test coverage detected