MCPcopy Create free account
hub / github.com/BaseXdb/basex / readNum

Method readNum

basex-core/src/main/java/org/basex/io/in/DataInput.java:107–115  ·  view source on GitHub ↗

Reads a compressed integer value; see Num for more. @return read value @throws IOException I/O Exception

()

Source from the content-addressed store, hash-verified

105 * @throws IOException I/O Exception
106 */
107 public int readNum() throws IOException {
108 final int v = read();
109 return v == -1 ? 0 : switch((v & 0xC0) >>> 6) {
110 case 0 -> v;
111 case 1 -> ((v & 0x3F) << 8) + read();
112 case 2 -> ((v & 0x3F) << 24) + (read() << 16) + (read() << 8) + read();
113 default -> (read() << 24) + (read() << 16) + (read() << 8) + read();
114 };
115 }
116
117 /**
118 * Reads a long value.

Callers 15

readTokenMethod · 0.95
readDiffsMethod · 0.95
readNumsMethod · 0.95
readTokensMethod · 0.95
readLongMethod · 0.95
testReadNumLongMethod · 0.45
testReadNumMethod · 0.45
testCursorLongMethod · 0.45
readStoreMethod · 0.45
readMethod · 0.45
NSNodeMethod · 0.45
readMethod · 0.45

Calls 1

readMethod · 0.65

Tested by 3

testReadNumLongMethod · 0.36
testReadNumMethod · 0.36
testCursorLongMethod · 0.36