MCPcopy Create free account
hub / github.com/Garten/sourcecraft / readBits

Method readBits

src/minecraft/reader/nbt/BitNbtReader.java:19–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17 }
18
19 public int readBits() throws IOException {
20 long result = 0;
21 long resultPos = 0;
22 for (int i = 0; i < this.amount; i++) {
23 if (this.currentPos == LONG_END) {
24 this.currentPos = 0;
25 this.currentByte = this.source.readLong();
26 }
27 long bit = (this.currentByte >> this.currentPos) & 1L;
28 long mask = (bit << resultPos);
29 result = result | mask;
30 resultPos++;
31 this.currentPos++;
32 }
33 return (int) result;
34 }
35}

Callers 1

readBlocksRawMethod · 0.95

Calls 1

readLongMethod · 0.80

Tested by

no test coverage detected