The offsetOf method of the DllLib class contains the following signatures:
offsetOf(Field structField)
offsetOf(Class structCls, String fieldName)
Returns the offset (measured in bytes) of a member of a native structure. The class, which is represented by structField.getClass, must have been declared using the @dll.struct compiler directive (or @com.struct).
Note The getClass method is from the java.lang.Object class.
public native static int offsetOf(Field structField);
Returns the size of the native structure (in bytes).
structField | The field to obtain the offset of. |
Returns the offset (measured in bytes) of a member of a native structure. The class, which is represented by structCls, must have been declared using the @dll.struct compiler directive (or @com.struct).
public static int offsetOf(Class structCls, String fieldName) throws SecurityException;
Returns the size of the native structure in bytes.
structCls | The class declared by using @dll.struct. |
fieldName | The name of the field to examine. |
SecurityException if the caller lacks permissions to use the java.lang.reflect API.