ReadVarUint32 reads a VarUint32 and sets error on bounds violation
(err *Error)
| 1321 | |
| 1322 | // ReadVarUint32 reads a VarUint32 and sets error on bounds violation |
| 1323 | func (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) |
| 1331 | func (b *ByteBuffer) readVarUint32Fast(err *Error) uint32 { |