Decodes the next VLQValue from the provided CharIterator.
(CharIterator in)
| 101 | * Decodes the next VLQValue from the provided CharIterator. |
| 102 | */ |
| 103 | public static int decode(CharIterator in) { |
| 104 | int result = 0; |
| 105 | boolean continuation; |
| 106 | int shift = 0; |
| 107 | do { |
| 108 | char c = in.next(); |
| 109 | int digit = Base64.fromBase64(c); |
| 110 | continuation = (digit & VLQ_CONTINUATION_BIT) != 0; |
| 111 | digit &= VLQ_BASE_MASK; |
| 112 | result = result + (digit << shift); |
| 113 | shift = shift + VLQ_BASE_SHIFT; |
| 114 | } while (continuation); |
| 115 | |
| 116 | return fromVLQSigned(result); |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * A simple interface for advancing through a sequence of characters, that |
no test coverage detected