Check that indirection won't cause us to write outside the malloc'ed space.
(long off, long sz)
| 215 | * |
| 216 | */ |
| 217 | protected void boundsCheck(long off, long sz) { |
| 218 | if (off < 0) { |
| 219 | throw new IndexOutOfBoundsException("Invalid offset: " + off); |
| 220 | } |
| 221 | if (off + sz > size) { |
| 222 | String msg = "Bounds exceeds available space : size=" |
| 223 | + size + ", offset=" + (off + sz); |
| 224 | throw new IndexOutOfBoundsException(msg); |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | ////////////////////////////////////////////////////////////////////////// |
| 229 | // Raw read methods |
no outgoing calls
no test coverage detected