Top Description Inners Fields Constructors Methods
com.kenai.jffi

public final Class HeapInvocationBuffer

extends InvocationBuffer
Class Inheritance
Imports
java.math.BigDecimal, java.nio.ByteOrder

An implementation of InvocationBuffer that packs its parameters onto a java heap allocated buffer.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private abstract static class
private static class
HeapInvocationBuffer.BE32ArrayIO

Big endian, 32 bit array encoder

private static class
HeapInvocationBuffer.BE64ArrayIO

Big endian, 64 bit array encoder

private abstract static class
HeapInvocationBuffer.BigEndianArrayIO

Base class for all big-endian architecture array encoders.

private static class
pack-priv abstract static class
HeapInvocationBuffer.Encoder

Encodes java data types into native parameter frames

private static class
private static class
HeapInvocationBuffer.LE32ArrayIO

Little endian, 32 bit implementation of ArrayIO

private static class
HeapInvocationBuffer.LE64ArrayIO

Little endian, 64 bit implementation of ArrayIO

private abstract static class
HeapInvocationBuffer.LittleEndianArrayIO

Base class for all little-endian architecture array encoders.

Field Summary

Modifier and TypeField and Description
private final byte[]
private final CallContext
private ObjectBuffer
private static final int
private int
private int

Constructor Summary

AccessConstructor and Description
public
HeapInvocationBuffer(Function
The function that this buffer is going to be used with.
function
)

Creates a new instance of HeapInvocationBuffer.

public
HeapInvocationBuffer(CallContext
The CallContext describing how the function should be invoked
callContext
)

Creates a new instance of HeapInvocationBuffer.

public
HeapInvocationBuffer(CallContext
The CallContext describing how the function should be invoked
context
,
int objectCount)

Creates a new instance of HeapInvocationBuffer.

Method Summary

Modifier and TypeMethod and Description
pack-priv byte[]

Returns:

The backing array for this buffer.
array
()

Gets the backing array of this InvocationBuffer

private final ObjectBuffer
pack-priv ObjectBuffer

Returns:

An ObjectBuffer
objectBuffer
()

Gets the object buffer used to store java heap array parameters

public final void
putAddress(final long
A native address value to use as the parameter.
value
)

Implements abstract com.kenai.jffi.InvocationBuffer.putAddress.

Adds a native address parameter.
public final void
putArray(final byte[]
The java array to use as the pointer parameter.
array
,
int
The offset from the start of the array.
offset
,
int
The length of the array to use.
length
,
int
The flags to use (IN, OUT)
flags
)

Implements abstract com.kenai.jffi.InvocationBuffer.putArray.

Adds a java byte array as a pointer parameter.
public final void
putArray(final short[]
The java array to use as the pointer parameter.
array
,
int
The offset from the start of the array.
offset
,
int
The length of the array to use.
length
,
int
The flags to use (IN, OUT)
flags
)

Implements abstract com.kenai.jffi.InvocationBuffer.putArray.

Adds a java short array as a pointer parameter.
public final void
putArray(final int[]
The java array to use as the pointer parameter.
array
,
int
The offset from the start of the array.
offset
,
int
The length of the array to use.
length
,
int
The flags to use (IN, OUT)
flags
)

Implements abstract com.kenai.jffi.InvocationBuffer.putArray.

Adds a java int array as a pointer parameter.
public final void
putArray(final long[]
The java array to use as the pointer parameter.
array
,
int
The offset from the start of the array.
offset
,
int
The length of the array to use.
length
,
int
The flags to use (IN, OUT)
flags
)

Implements abstract com.kenai.jffi.InvocationBuffer.putArray.

Adds a java long array as a pointer parameter.
public final void
putArray(final float[]
The java array to use as the pointer parameter.
array
,
int
The offset from the start of the array.
offset
,
int
The length of the array to use.
length
,
int
The flags to use (IN, OUT)
flags
)

Implements abstract com.kenai.jffi.InvocationBuffer.putArray.

Adds a java float array as a pointer parameter.
public final void
putArray(final double[]
The java array to use as the pointer parameter.
array
,
int
The offset from the start of the array.
offset
,
int
The length of the array to use.
length
,
int
The flags to use (IN, OUT)
flags
)

Implements abstract com.kenai.jffi.InvocationBuffer.putArray.

Adds a java double array as a pointer parameter.
public final void
putByte(final int
An 8 bit integer value to use as the parameter.
value
)

Implements abstract com.kenai.jffi.InvocationBuffer.putByte.

Adds an 8 bit integer parameter.
public final void
putDirectBuffer(final Buffer
The buffer to use as a pointer argument.
value
,
int
An offset to add to the buffer native address.
offset
,
int
The length of the buffer to use.
length
)

Implements abstract com.kenai.jffi.InvocationBuffer.putDirectBuffer.

Adds a java direct buffer as a pointer parameter.
public final void
putDouble(final double
A 64 bit floating point value to use as the parameter.
value
)

Implements abstract com.kenai.jffi.InvocationBuffer.putDouble.

Adds a 64 bit floating point parameter.
public final void
putFloat(final float
A 32 bit floating point value to use as the parameter.
value
)

Implements abstract com.kenai.jffi.InvocationBuffer.putFloat.

Adds a 32 bit floating point parameter.
public final void
putInt(final int
A 32 bit integer value to use as the parameter.
value
)

Implements abstract com.kenai.jffi.InvocationBuffer.putInt.

Adds a 32 bit integer parameter.
public final void
public final void
public final void
putLong(final long
A 64 bit integer value to use as the parameter.
value
)

Implements abstract com.kenai.jffi.InvocationBuffer.putLong.

Adds a 64 bit integer parameter.
public final void
putLongDouble(final double value)

public final void
public final void
public final void
putObject(Object o, ObjectParameterStrategy<T> strategy, int flags)

public final void
putShort(final int
A 16 bit integer value to use as the parameter.
value
)

Implements abstract com.kenai.jffi.InvocationBuffer.putShort.

Adds a 16 bit integer parameter.
public final void
putStruct(final byte[]
A java byte array with the struct contents.
struct
,
int
The offset from the start of the array.
offset
)

Implements abstract com.kenai.jffi.InvocationBuffer.putStruct.

Adds a struct or union as a parameter.
public final void
putStruct(final long
The native address to use as the struct contents.
struct
)

Implements abstract com.kenai.jffi.InvocationBuffer.putStruct.

Adds a struct or union as a parameter.