MCPcopy Index your code
hub / github.com/java-native-access/jna / boundsCheck

Method boundsCheck

src/com/sun/jna/Memory.java:217–226  ·  view source on GitHub ↗

Check that indirection won't cause us to write outside the malloc'ed space.

(long off, long sz)

Source from the content-addressed store, hash-verified

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

Callers 15

shareMethod · 0.95
readMethod · 0.95
writeMethod · 0.95
getByteMethod · 0.95
getCharMethod · 0.95
getShortMethod · 0.95
getIntMethod · 0.95
getLongMethod · 0.95
getFloatMethod · 0.95
getDoubleMethod · 0.95
getPointerMethod · 0.95
getByteBufferMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected