MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / decode

Method decode

src/main/java/fieldnashorn/sourcemap/Base64VLQ.java:103–117  ·  view source on GitHub ↗

Decodes the next VLQValue from the provided CharIterator.

(CharIterator in)

Source from the content-addressed store, hash-verified

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

Callers 6

nextValueMethod · 0.95
deserializeMethod · 0.80
decodePercentMethod · 0.80
diff_fromDeltaMethod · 0.80
patch_fromTextMethod · 0.80

Calls 3

fromBase64Method · 0.95
fromVLQSignedMethod · 0.95
nextMethod · 0.65

Tested by

no test coverage detected