/** * Returns a Address instance representing the specified {@code int} value. * * @param address an {@code int} value * @return an {@code Address} instance representing {@code address} */ public static Address valueOf(int address) { return address == 0 ? NULL : new Address((long) address & 0xffffffffL); } }
public static int intValue(Address ptr) { return ptr != null ? ptr.intValue() : 0; }
public static long longValue(Address ptr) { return ptr != null ? ptr.longValue() : 0L; }
/** * Creates a new reference to an integer value */ public AddressByReference() { super(Address.valueOf(0)); }
/** * Copies the address value to native memory * * @param runtime * @param memory the native memory buffer */ public void toNative(Runtime runtime, Pointer memory, long offset) { memory.putAddress(offset, value.nativeAddress()); }
/** * Returns a string representation of this <code>Address</code>. * * @return a string representation of this <code>Address</code>. */ @Override public final java.lang.String toString() { return get().toString(); } }
/** * Creates a new reference to an integer value */ public AddressByReference() { super(Address.valueOf(0)); }
/** * Copies the address value to native memory * * @param runtime The current runtime. * @param memory The native memory buffer * @param offset The offset. */ public void toNative(Runtime runtime, Pointer memory, long offset) { memory.putAddress(offset, value.nativeAddress()); }
/** * Returns a string representation of this <code>Address</code>. * * @return a string representation of this <code>Address</code>. */ @Override public final java.lang.String toString() { return get().toString(); } }
/** * Creates a new reference to an integer value */ public AddressByReference() { super(Address.valueOf(0)); }
/** * Copies the address value to native memory * * @param runtime The current runtime. * @param memory The native memory buffer * @param offset The offset. */ public void toNative(Runtime runtime, Pointer memory, long offset) { memory.putAddress(offset, value.nativeAddress()); }
/** * Returns a Address instance representing the specified {@code long} value. * * @param address a {@code long} value * @return an {@code Address} instance representing {@code address} */ public static Address valueOf(long address) { return address == 0 ? NULL : new Address(address); }
public static int intValue(Address ptr) { return ptr != null ? ptr.intValue() : 0; }
public static long longValue(Address ptr) { return ptr != null ? ptr.longValue() : 0L; }
/** * Returns a string representation of this <code>Address</code>. * * @return a string representation of this <code>Address</code>. */ @Override public final java.lang.String toString() { return get().toString(); } }
@Override public Address fromNative(Number value, FromNativeContext fromNativeContext) { return Address.valueOf(value.longValue()); } }
/** * Puts a {@link jnr.ffi.Address} value into the native memory. * * @param value the value to write. */ public final void set(jnr.ffi.Address value) { getMemory().putAddress(offset(), value != null ? value.nativeAddress() : 0); }