Writes a VLQ encoded value to the provide appendable. @throws java.io.IOException
(Appendable out, int value)
| 85 | * @throws java.io.IOException |
| 86 | */ |
| 87 | public static void encode(Appendable out, int value) |
| 88 | throws IOException { |
| 89 | value = toVLQSigned(value); |
| 90 | do { |
| 91 | int digit = value & VLQ_BASE_MASK; |
| 92 | value >>>= VLQ_BASE_SHIFT; |
| 93 | if (value > 0) { |
| 94 | digit |= VLQ_CONTINUATION_BIT; |
| 95 | } |
| 96 | out.append(Base64.toBase64(digit)); |
| 97 | } while (value > 0); |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Decodes the next VLQValue from the provided CharIterator. |
no test coverage detected