Reads a compressed integer value; see Num for more. @return read value @throws IOException I/O Exception
()
| 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. |