For example, the following C code,
extern void get_a(char *ap);
int foo(void) {
char 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 ByteByReference ap);
}
and used like this
ByteByReference ap = new ByteByReference();
lib.get_a(ap);
System.out.printf("a from lib=%d\n", a.byteValue());
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | fromNative(Runtime
The current runtime. runtime, Pointer the native memory buffer. buffer, long The offset of the field. 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 buffer, long The offset of the field. offset)Implements jnr. |
| ByteByReference | back to summary |
|---|---|
| public ByteByReference() Creates a new reference to a byte value initialized to zero. | |
| ByteByReference | back to summary |
|---|---|
| public ByteByReference(Byte value) Creates a new reference to a byte value
| |
| ByteByReference | back to summary |
|---|---|
| public ByteByReference(byte value) Creates a new reference to a byte value
| |
| fromNative | back to summary |
|---|---|
| public void fromNative(Runtime runtime, Pointer buffer, long offset) Implements jnr. Copies the Byte 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 buffer, long offset) Implements jnr. Copies the Byte value to native memory
| |