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

Method continueReadVarUint32

go/fory/buffer.go:1563–1583  ·  view source on GitHub ↗
(readIdx int, bulkRead, value uint32, err *Error)

Source from the content-addressed store, hash-verified

1561}
1562
1563func (b *ByteBuffer) continueReadVarUint32(readIdx int, bulkRead, value uint32, err *Error) uint32 {
1564 readIdx++
1565 value |= (bulkRead >> 2) & 0x1fc000
1566 if bulkRead&0x800000 != 0 {
1567 readIdx++
1568 value |= (bulkRead >> 3) & 0xfe00000
1569 if bulkRead&0x80000000 != 0 {
1570 v := b.data[readIdx]
1571 if v > 0x0F {
1572 if err != nil {
1573 *err = DeserializationError("VarUint32 overflow")
1574 }
1575 return 0
1576 }
1577 readIdx++
1578 value |= uint32(v&0x7F) << 28
1579 }
1580 }
1581 b.readerIndex = readIdx
1582 return value
1583}
1584
1585func (b *ByteBuffer) readVaruint36Slow(err *Error) uint64 {
1586 var shift uint

Callers 1

readVarUint32Small14Method · 0.95

Calls 2

DeserializationErrorFunction · 0.85
uint32Function · 0.50

Tested by

no test coverage detected