MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / writeVar

Method writeVar

src/main/java/core/packetproxy/common/Protobuf3.java:134–154  ·  view source on GitHub ↗
(long var, ByteArrayOutputStream output)

Source from the content-addressed store, hash-verified

132 }
133
134 public static void writeVar(long var, ByteArrayOutputStream output) {
135 for (int i = 1; i <= 10; ++i) {
136
137 byte b = (byte) (var & 0x7f);
138 if (i == 10) {
139
140 var = 0;
141 } else {
142
143 var = (var >>> 7);
144 }
145 if (var == 0) {
146
147 output.write(b);
148 break;
149 } else {
150
151 output.write((byte) (b | 0x80));
152 }
153 }
154 }
155
156 public static boolean validateBit64(ByteArrayInputStream input) {
157 return input.available() < 8 ? false : true;

Callers 2

encodeDataMethod · 0.95
writeToMethod · 0.80

Calls 1

writeMethod · 0.65

Tested by

no test coverage detected