Indirect the native pointer to malloc space, a la Pointer.getPointer . But this method performs a bounds checks to ensure that the indirection does not cause memory outside the malloc ed space to be accessed. @see Pointer#getPointer(long)
(long offset)
| 568 | * @see Pointer#getPointer(long) |
| 569 | */ |
| 570 | @Override |
| 571 | public Pointer getPointer(long offset) { |
| 572 | boundsCheck(offset, Native.POINTER_SIZE); |
| 573 | return shareReferenceIfInBounds(super.getPointer(offset)); |
| 574 | } |
| 575 | |
| 576 | /** |
| 577 | * Get a ByteBuffer mapped to a portion of this memory. |