Gets a 32-bit integer at the specified absolute index in this buffer. @throws IndexOutOfBoundsException if the specified index is less than 0 or index + 4 is greater than this.capacity
(int index)
| 137 | * {@code index + 4} is greater than {@code this.capacity} |
| 138 | */ |
| 139 | public int getInt(int index) { |
| 140 | Preconditions.checkPositionIndexes(index, index + Ints.BYTES, this.length); |
| 141 | index += offset; |
| 142 | return (data[index] & 0xff) | |
| 143 | (data[index + 1] & 0xff) << 8 | |
| 144 | (data[index + 2] & 0xff) << 16 | |
| 145 | (data[index + 3] & 0xff) << 24; |
| 146 | } |
| 147 | |
| 148 | /** |
| 149 | * Gets a 64-bit long integer at the specified absolute {@code index} in |
no outgoing calls