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

Method writeUnsignedVarInt

protocol/encode.go:347–363  ·  view source on GitHub ↗
(i uint64)

Source from the content-addressed store, hash-verified

345}
346
347func (e *encoder) writeUnsignedVarInt(i uint64) {
348 b := e.buffer[:]
349 n := 0
350
351 for i >= 0x80 && n < len(b) {
352 b[n] = byte(i) | 0x80
353 i >>= 7
354 n++
355 }
356
357 if n < len(b) {
358 b[n] = byte(i)
359 n++
360 }
361
362 e.Write(b[:n])
363}
364
365type encodeFunc func(*encoder, value)
366

Callers 11

TestVarIntsFunction · 0.95
WriteRequestFunction · 0.95
encodeCompactArrayMethod · 0.95
writeCompactStringMethod · 0.95
writeCompactBytesMethod · 0.95
writeCompactNullBytesMethod · 0.95
writeVarIntMethod · 0.95
WriteResponseFunction · 0.95
structEncodeFuncOfFunction · 0.80

Calls 1

WriteMethod · 0.95

Tested by 1

TestVarIntsFunction · 0.76