Indirect the native pointer to malloc space, a la Pointer.getByte . 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#getByte(long)
(long offset)
| 470 | * @see Pointer#getByte(long) |
| 471 | */ |
| 472 | @Override |
| 473 | public byte getByte(long offset) { |
| 474 | boundsCheck(offset, 1); |
| 475 | return super.getByte(offset); |
| 476 | } |
| 477 | |
| 478 | /** |
| 479 | * Indirect the native pointer to <code>malloc</code> space, a la |