MCPcopy Create free account
hub / github.com/apache/fory / continuePutVarint36

Method continuePutVarint36

go/fory/buffer.go:1431–1448  ·  view source on GitHub ↗
(index int, encoded, value uint64)

Source from the content-addressed store, hash-verified

1429}
1430
1431func (b *ByteBuffer) continuePutVarint36(index int, encoded, value uint64) int {
1432 // bits 14
1433 encoded |= ((value & 0x1fc000) << 2) | 0x8000
1434 if value>>21 == 0 {
1435 b.unsafePutInt32(index, int32(encoded))
1436 return 3
1437 }
1438 // bits 21
1439 encoded |= ((value & 0xfe00000) << 3) | 0x800000
1440 if value>>28 == 0 {
1441 b.unsafePutInt32(index, int32(encoded))
1442 return 4
1443 }
1444 // bits 28
1445 encoded |= ((value & 0xff0000000) << 4) | 0x80000000
1446 b.unsafePutInt64(index, encoded)
1447 return 5
1448}
1449
1450func (b *ByteBuffer) unsafePutInt32(index int, v int32) {
1451 binary.LittleEndian.PutUint32(b.data[index:], uint32(v))

Callers 1

Calls 3

unsafePutInt32Method · 0.95
unsafePutInt64Method · 0.95
int32Function · 0.50

Tested by

no test coverage detected