MCPcopy Create free account
hub / github.com/cabaletta/baritone / serialize0

Method serialize0

src/main/java/baritone/utils/type/VarInt.java:57–68  ·  view source on GitHub ↗
(int valueIn)

Source from the content-addressed store, hash-verified

55 }
56
57 private static byte[] serialize0(int valueIn) {
58 ByteList bytes = new ByteArrayList();
59
60 int value = valueIn;
61 while ((value & 0x80) != 0) {
62 bytes.add((byte) (value & 0x7F | 0x80));
63 value >>>= 7;
64 }
65 bytes.add((byte) (value & 0xFF));
66
67 return bytes.toByteArray();
68 }
69
70 public static VarInt read(byte[] bytes) {
71 return read(bytes, 0);

Callers 1

VarIntMethod · 0.95

Calls 2

addMethod · 0.80
toByteArrayMethod · 0.80

Tested by

no test coverage detected