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

Method getNullableInt64Array

real_decoder.go:598–622  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

596}
597
598func (rd *realFlexibleDecoder) getNullableInt64Array() ([]int64, error) {
599 n, err := rd.getUVarint()
600 if err != nil {
601 return nil, err
602 }
603
604 if n == 0 {
605 return nil, nil
606 }
607
608 arrayLength := n - 1
609
610 if uint64(rd.remaining()/8) < arrayLength { //nolint:gosec // G115 - remaining() is non-negative
611 rd.off = len(rd.raw)
612 return nil, ErrInsufficientData
613 }
614
615 ret := make([]int64, int(arrayLength)) //nolint:gosec // G115 - value bounded by remaining() above
616
617 for i := range ret {
618 ret[i] = int64(binary.BigEndian.Uint64(rd.raw[rd.off:]))
619 rd.off += 8
620 }
621 return ret, nil
622}
623
624func (rd *realFlexibleDecoder) getStringArray() ([]string, error) {
625 n, err := rd.getArrayLength()

Callers 2

getInt64ArrayMethod · 0.95

Calls 2

getUVarintMethod · 0.65
remainingMethod · 0.65