MCPcopy
hub / github.com/segmentio/kafka-go / varIntLen

Function varIntLen

write.go:565–575  ·  view source on GitHub ↗
(i int64)

Source from the content-addressed store, hash-verified

563}
564
565func varIntLen(i int64) int {
566 u := uint64((i << 1) ^ (i >> 63)) // zig-zag encoding
567 n := 0
568
569 for u >= 0x80 {
570 u >>= 7
571 n++
572 }
573
574 return n + 1
575}
576
577func varBytesLen(b []byte) int {
578 return varIntLen(int64(len(b))) + len(b)

Callers 5

recordBatchSizeFunction · 0.85
recordSizeFunction · 0.85
varBytesLenFunction · 0.85
varStringLenFunction · 0.85
varArrayLenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected