Top Description Fields Constructors Methods
jnr.ffi.byref

public final Class LongLongByReference

extends AbstractNumberReference<Long>
Class Inheritance
Imports
jnr.ffi.Pointer, .Runtime

LongLongByReference is used when the address of a native long long value must be passed as a parameter to a function.

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());

Field Summary

Inherited from jnr.ffi.byref.AbstractNumberReference:
value

Constructor Summary

AccessConstructor and Description
public
LongLongByReference()

Creates a new reference to a long long value initialized to zero.

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

Method Summary

Modifier and TypeMethod and Description
public void
fromNative(Runtime
the current runtime.
runtime
,
Pointer
the native memory buffer.
memory
,
long
the memory offset.
offset
)

Implements jnr.ffi.byref.ByReference.fromNative.

Copies the value from native memory
public final int

Returns:

the size of a byte in bytes
nativeSize
(Runtime
the current runtime.
runtime
)

Implements jnr.ffi.byref.ByReference.nativeSize.

Gets the native size of type of reference in bytes.
public void
toNative(Runtime
the current runtime.
runtime
,
Pointer
the native memory buffer.
memory
,
long
the memory offset.
offset
)

Implements jnr.ffi.byref.ByReference.toNative.

Copies the value to native memory
Inherited from jnr.ffi.byref.AbstractNumberReference:
byteValuecheckNulldoubleValuefloatValuegetValueintValuelongValueshortValue

Constructor Detail

LongLongByReferenceback to summary
public LongLongByReference()

Creates a new reference to a long long value initialized to zero.

LongLongByReferenceback to summary
public LongLongByReference(Long value)

Creates a new reference to a native longlong value

Parameters
value:Long

the initial native value

LongLongByReferenceback to summary
public LongLongByReference(long value)

Creates a new reference to a native longlong value

Parameters
value:long

the initial native value

Method Detail

fromNativeback to summary
public void fromNative(Runtime runtime, Pointer memory, long offset)

Implements jnr.ffi.byref.ByReference.fromNative.

Copies the value from native memory

Parameters
runtime:Runtime

the current runtime.

memory:Pointer

the native memory buffer.

offset:long

the memory offset.

nativeSizeback to summary
public final int nativeSize(Runtime runtime)

Implements jnr.ffi.byref.ByReference.nativeSize.

Gets the native size of type of reference in bytes.

Parameters
runtime:Runtime

the current runtime.

Returns:int

the size of a byte in bytes

toNativeback to summary
public void toNative(Runtime runtime, Pointer memory, long offset)

Implements jnr.ffi.byref.ByReference.toNative.

Copies the value to native memory

Parameters
runtime:Runtime

the current runtime.

memory:Pointer

the native memory buffer.

offset:long

the memory offset.