MCPcopy Create free account
hub / github.com/BuildCraft/BuildCraft / readType

Method readType

common/buildcraft/lib/nbt/WrittenType.java:36–44  ·  view source on GitHub ↗
(ByteBuf bytes)

Source from the content-addressed store, hash-verified

34 }
35
36 public static WrittenType readType(ByteBuf bytes) throws IOException {
37 byte val = bytes.readByte();
38 for (WrittenType type : ORDERED_VALUES) {
39 if (val == type.numBytes - 1) {
40 return type;
41 }
42 }
43 throw new IOException("Incorrect size given, expected any of [0, 1, 2, 3] but got " + val);
44 }
45
46 public void writeIndex(ByteBuf bytes, int index) {
47 switch (this) {

Callers 1

readInternalMethod · 0.95

Calls 1

readByteMethod · 0.80

Tested by

no test coverage detected