| 88 | } |
| 89 | |
| 90 | bool InputBuffer::ReadVarInt64(uint64_t* value) |
| 91 | { |
| 92 | uint64_t result = 0; |
| 93 | int count = 0; |
| 94 | |
| 95 | while (true) |
| 96 | { |
| 97 | if (m_Current >= m_End || count == WIRE_MAXVARINTBYTES) |
| 98 | return false; |
| 99 | |
| 100 | uint32_t b = *m_Current++; |
| 101 | result |= ((uint64_t) (b & 0x7f)) << (7 * count); |
| 102 | count++; |
| 103 | |
| 104 | if (!(b & 0x80)) |
| 105 | { |
| 106 | break; |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | *value = result; |
| 111 | return true; |
| 112 | } |
| 113 | |
| 114 | bool InputBuffer::ReadFixed32(uint32_t *value) |
| 115 | { |