ReadVarUint32Small7 reads a VarUint32 in small-7 format with error checking
(err *Error)
| 1526 | |
| 1527 | // ReadVarUint32Small7 reads a VarUint32 in small-7 format with error checking |
| 1528 | func (b *ByteBuffer) ReadVarUint32Small7(err *Error) uint32 { |
| 1529 | if b.readerIndex >= len(b.data) { |
| 1530 | if !b.fill(1, err) { |
| 1531 | return 0 |
| 1532 | } |
| 1533 | } |
| 1534 | readIdx := b.readerIndex |
| 1535 | v := b.data[readIdx] |
| 1536 | readIdx++ |
| 1537 | if v&0x80 == 0 { |
| 1538 | b.readerIndex = readIdx |
| 1539 | return uint32(v) |
| 1540 | } |
| 1541 | return b.readVarUint32Small14(err) |
| 1542 | } |
| 1543 | |
| 1544 | func (b *ByteBuffer) readVarUint32Small14(err *Error) uint32 { |
| 1545 | readIdx := b.readerIndex |