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

Method ReadVarUint32

go/fory/buffer.go:1323–1328  ·  view source on GitHub ↗

ReadVarUint32 reads a VarUint32 and sets error on bounds violation

(err *Error)

Source from the content-addressed store, hash-verified

1321
1322// ReadVarUint32 reads a VarUint32 and sets error on bounds violation
1323func (b *ByteBuffer) ReadVarUint32(err *Error) uint32 {
1324 if b.remaining() >= 8 { // Need 8 bytes for bulk uint64 read in fast path
1325 return b.readVarUint32Fast(err)
1326 }
1327 return b.readVarUint32Slow(err)
1328}
1329
1330// Fast path reading (when the remaining bytes are sufficient)
1331func (b *ByteBuffer) readVarUint32Fast(err *Error) uint32 {

Callers 15

ReadLengthMethod · 0.95
ReadVarint32Method · 0.95
decodeTypeDefFunction · 0.95
testBufferFunction · 0.95
testBufferVarFunction · 0.95
readSharedTypeMetaMethod · 0.45
ReadTypeInfoMethod · 0.45
ReadTypeInfoForTypeMethod · 0.45
readMetaStringMethod · 0.45
ReadDataMethod · 0.45

Calls 3

remainingMethod · 0.95
readVarUint32FastMethod · 0.95
readVarUint32SlowMethod · 0.95