For example, the following C code,
extern void get_a(long long * ap);
long long foo(void) {
long long a;
// pass a reference to 'a' so get_a() can fill it out
get_a(&a);
return a;
}
Would be declared in java as
interface Lib {
void get_a(@Out LongLongByReference ap);
}
and used like this
LongLongByReference ap = new LongLongByReference();
lib.get_a(ap);
System.out.printf("a from lib=%d\n", a.longValue());
| Access | Constructor and Description |
|---|---|
| public | |
| public | LongLongByReference(Long
the initial native value value)Creates a new reference to a native longlong value |
| public | LongLongByReference(long
the initial native value value)Creates a new reference to a native longlong value |
| Modifier and Type | Method and Description |
|---|---|
| public void | fromNative(Runtime
the current runtime. runtime, Pointer the native memory buffer. memory, long the memory offset. offset)Implements jnr. |
| public final int | Returns: the size of a byte in bytesthe current runtime. runtime)Implements jnr. |
| public void | toNative(Runtime
the current runtime. runtime, Pointer the native memory buffer. memory, long the memory offset. offset)Implements jnr. |
| LongLongByReference | back to summary |
|---|---|
| public LongLongByReference() Creates a new reference to a long long value initialized to zero. | |
| LongLongByReference | back to summary |
|---|---|
| public LongLongByReference(Long value) Creates a new reference to a native longlong value
| |
| LongLongByReference | back to summary |
|---|---|
| public LongLongByReference(long value) Creates a new reference to a native longlong value
| |
| fromNative | back to summary |
|---|---|
| public void fromNative(Runtime runtime, Pointer memory, long offset) Implements jnr. Copies the value from native memory | |
| nativeSize | back to summary |
|---|---|
| public final int nativeSize(Runtime runtime) Implements jnr. Gets the native size of type of reference in bytes.
| |
| toNative | back to summary |
|---|---|
| public void toNative(Runtime runtime, Pointer memory, long offset) Implements jnr. Copies the value to native memory | |