Returns the calculated offset of the given field. @param name field to examine @return return offset of the given field
(String name)
| 622 | * @return return offset of the given field |
| 623 | */ |
| 624 | protected int fieldOffset(String name) { |
| 625 | ensureAllocated(); |
| 626 | StructField f = fields().get(name); |
| 627 | if (f == null) { |
| 628 | throw new IllegalArgumentException("No such field: " + name); |
| 629 | } |
| 630 | return f.offset; |
| 631 | } |
| 632 | |
| 633 | /** Force a read of the given field from native memory. The Java field |
| 634 | * will be updated from the current contents of native memory. |