Top Description Inners Fields Constructors Methods
com.kenai.jffi

public abstract Class UnsafeMemoryIO

extends MemoryIO
Class Inheritance
Known Direct Subclasses
com.kenai.jffi.UnsafeMemoryIO.UnsafeMemoryIO32, com.kenai.jffi.UnsafeMemoryIO.UnsafeMemoryIO64
Imports
java.lang.reflect.Field

An implementation of MemoryIO using sun.misc.Unsafe

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
UnsafeMemoryIO.UnsafeMemoryIO32

A 32 bit optimized implementation of MemoryIO using sun.misc.Unsafe

pack-priv static class
UnsafeMemoryIO.UnsafeMemoryIO64

A 64 bit optimized implementation of MemoryIO using sun.misc.Unsafe

Field Summary

Modifier and TypeField and Description
protected static Unsafe
Inherited from com.kenai.jffi.MemoryIO:
ADDRESS_MASKforeign

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final void
_copyMemory(long
The source memory address.
src
,
long
The destination memory address.
dst
,
long
The number of bytes to copy.
size
)

Implements abstract com.kenai.jffi.MemoryIO._copyMemory.

Copies contents of a native memory location to another native memory location.
public final byte
getByte(long
The memory location to get the value from.
address
)

Implements abstract com.kenai.jffi.MemoryIO.getByte.

Reads an 8 bit integer from a native memory location.
public final void
getByteArray(long
The native memory address to copy the array from.
address
,
byte[]
The java array to copy.
data
,
int
The offset within the array to start copying to.
offset
,
int
The number of array elements to copy.
length
)

Implements abstract com.kenai.jffi.MemoryIO.getByteArray.

Reads a java byte array from native memory.
public final void
getCharArray(long
The native memory address to copy the array from.
address
,
char[]
The java array to copy.
data
,
int
The offset within the array to start copying to.
offset
,
int
The number of array elements to copy.
length
)

Implements abstract com.kenai.jffi.MemoryIO.getCharArray.

Reads a java char array from native memory.
public final double
getDouble(long
The memory location to get the value from.
address
)

Implements abstract com.kenai.jffi.MemoryIO.getDouble.

Reads a 64 bit floating point value from a native memory location.
public final void
getDoubleArray(long
The native memory address to copy the array from.
address
,
double[]
The java array to copy.
data
,
int
The offset within the array to start copying to.
offset
,
int
The number of array elements to copy.
length
)

Implements abstract com.kenai.jffi.MemoryIO.getDoubleArray.

Reads a java double array from native memory.
public final float
getFloat(long
The memory location to get the value from.
address
)

Implements abstract com.kenai.jffi.MemoryIO.getFloat.

Reads a 32 bit floating point value from a native memory location.
public final void
getFloatArray(long
The native memory address to copy the array from.
address
,
float[]
The java array to copy.
data
,
int
The offset within the array to start copying to.
offset
,
int
The number of array elements to copy.
length
)

Implements abstract com.kenai.jffi.MemoryIO.getFloatArray.

Reads a java float array from native memory.
public final int
getInt(long
The memory location to get the value from.
address
)

Implements abstract com.kenai.jffi.MemoryIO.getInt.

Reads a 32 bit integer from a native memory location.
public final void
getIntArray(long
The native memory address to copy the array from.
address
,
int[]
The java array to copy.
data
,
int
The offset within the array to start copying to.
offset
,
int
The number of array elements to copy.
length
)

Implements abstract com.kenai.jffi.MemoryIO.getIntArray.

Reads a java int array from native memory.
public final long
getLong(long
The memory location to get the value from.
address
)

Implements abstract com.kenai.jffi.MemoryIO.getLong.

Reads a 64 bit integer from a native memory location.
public final void
getLongArray(long
The native memory address to copy the array from.
address
,
long[]
The java array to copy.
data
,
int
The offset within the array to start copying to.
offset
,
int
The number of array elements to copy.
length
)

Implements abstract com.kenai.jffi.MemoryIO.getLongArray.

Reads a java long array from native memory.
public final short
getShort(long
The memory location to get the value from.
address
)

Implements abstract com.kenai.jffi.MemoryIO.getShort.

Reads a 16 bit integer from a native memory location.
public final void
getShortArray(long
The native memory address to copy the array from.
address
,
short[]
The java array to copy.
data
,
int
The offset within the array to start copying to.
offset
,
int
The number of array elements to copy.
length
)

Implements abstract com.kenai.jffi.MemoryIO.getShortArray.

Reads a java short array from native memory.
public final long
getStringLength(long
The native address of the string.
address
)

Implements abstract com.kenai.jffi.MemoryIO.getStringLength.

Gets the length of a native ascii or utf-8 string.
private static Object
public final byte[]
getZeroTerminatedByteArray(long
The address to read the data from.
address
)

Implements abstract com.kenai.jffi.MemoryIO.getZeroTerminatedByteArray.

Reads a byte array from native memory, stopping when a zero byte is found.
public final byte[]
getZeroTerminatedByteArray(long
The address to read the data from.
address
,
int
The limit of the memory area to scan for a zero byte.
maxlen
)

Implements abstract com.kenai.jffi.MemoryIO.getZeroTerminatedByteArray.

Reads a byte array from native memory, stopping when a zero byte is found, or the maximum length is reached.
public final long
memchr(long
The native memory address to start searching.
address
,
int
The value to search for.
value
,
long
The size of the native memory region being searched.
size
)

Implements abstract com.kenai.jffi.MemoryIO.memchr.

Gets the address of a byte value in a native memory region.
public final void
memcpy(long
The destination memory address.
dst
,
long
The source memory address.
src
,
long
The number of bytes to copy.
size
)

Implements abstract com.kenai.jffi.MemoryIO.memcpy.

Copies bytes from one memory location to another.
public final void
memmove(long
The destination memory address.
dst
,
long
The source memory address.
src
,
long
The number of bytes to copy.
size
)

Implements abstract com.kenai.jffi.MemoryIO.memmove.

Copies potentially overlapping memory areas.
public final void
putByte(long
The memory location to put the value.
address
,
byte
The value to write to memory.
value
)

Implements abstract com.kenai.jffi.MemoryIO.putByte.

Writes an 8 bit integer value to a native memory location.
public final void
putByteArray(long
The native memory address to copy the array to.
address
,
byte[]
The java array to copy.
data
,
int
The offset within the array to start copying from.
offset
,
int
The number of array elements to copy.
length
)

Implements abstract com.kenai.jffi.MemoryIO.putByteArray.

Writes a java byte array to native memory.
public final void
putCharArray(long
The native memory address to copy the array to.
address
,
char[]
The java array to copy.
data
,
int
The offset within the array to start copying from.
offset
,
int
The number of array elements to copy.
length
)

Implements abstract com.kenai.jffi.MemoryIO.putCharArray.

Writes a java char array to native memory.
public final void
putDouble(long
The memory location to put the value.
address
,
double
The value to write to memory.
value
)

Implements abstract com.kenai.jffi.MemoryIO.putDouble.

Writes a 64 bit floating point value to a native memory location.
public final void
putDoubleArray(long
The native memory address to copy the array to.
address
,
double[]
The java array to copy.
data
,
int
The offset within the array to start copying from.
offset
,
int
The number of array elements to copy.
length
)

Implements abstract com.kenai.jffi.MemoryIO.putDoubleArray.

Writes a java double array to native memory.
public final void
putFloat(long
The memory location to put the value.
address
,
float
The value to write to memory.
value
)

Implements abstract com.kenai.jffi.MemoryIO.putFloat.

Writes a 32 bit floating point value to a native memory location.
public final void
putFloatArray(long
The native memory address to copy the array to.
address
,
float[]
The java array to copy.
data
,
int
The offset within the array to start copying from.
offset
,
int
The number of array elements to copy.
length
)

Implements abstract com.kenai.jffi.MemoryIO.putFloatArray.

Writes a java double array to native memory.
public final void
putInt(long
The memory location to put the value.
address
,
int
The value to write to memory.
value
)

Implements abstract com.kenai.jffi.MemoryIO.putInt.

Writes a 32 bit integer value to a native memory location.
public final void
putIntArray(long
The native memory address to copy the array to.
address
,
int[]
The java array to copy.
data
,
int
The offset within the array to start copying from.
offset
,
int
The number of array elements to copy.
length
)

Implements abstract com.kenai.jffi.MemoryIO.putIntArray.

Writes a java int array to native memory.
public final void
putLong(long
The memory location to put the value.
address
,
long
The value to write to memory.
value
)

Implements abstract com.kenai.jffi.MemoryIO.putLong.

Writes a 64 bit integer value to a native memory location.
public final void
putLongArray(long
The native memory address to copy the array to.
address
,
long[]
The java array to copy.
data
,
int
The offset within the array to start copying from.
offset
,
int
The number of array elements to copy.
length
)

Implements abstract com.kenai.jffi.MemoryIO.putLongArray.

Writes a java long array to native memory.
public final void
putShort(long
The memory location to put the value.
address
,
short
The value to write to memory.
value
)

Implements abstract com.kenai.jffi.MemoryIO.putShort.

Writes a 16 bit integer value to a native memory location.
public final void
putShortArray(long
The native memory address to copy the array to.
address
,
short[]
The java array to copy.
data
,
int
The offset within the array to start copying from.
offset
,
int
The number of array elements to copy.
length
)

Implements abstract com.kenai.jffi.MemoryIO.putShortArray.

Writes a java short array to native memory.
public final void
putZeroTerminatedByteArray(long
The address to copy to.
address
,
byte[]
The byte array to copy to native memory
data
,
int
The offset within the byte array to begin copying from
offset
,
int
The number of bytes to copy to native memory
length
)

Implements abstract com.kenai.jffi.MemoryIO.putZeroTerminatedByteArray.

Copies a java byte array to native memory and appends a NUL terminating byte

Note

A total of length + 1 bytes is written to native memory.

public final void
setMemory(long
The address of start of the native memory.
src
,
long
The number of bytes to set.
size
,
byte
The value to set the native memory to.
value
)

Implements abstract com.kenai.jffi.MemoryIO.setMemory.

Sets a region of native memory to a specific byte value.
Inherited from com.kenai.jffi.MemoryIO:
allocateMemorycopyMemoryfreeMemorygetAddressgetCheckedInstancegetDirectBufferAddressgetInstancegetZeroTerminatedByteArrayindexOfindexOfisUnsafeAvailablememsetnewDirectByteBufferputAddress

Field Detail

unsafeback to summary
protected static Unsafe unsafe

Constructor Detail

UnsafeMemoryIOback to summary
public UnsafeMemoryIO()

Method Detail

_copyMemoryback to summary
public final void _copyMemory(long src, long dst, long size)

Implements abstract com.kenai.jffi.MemoryIO._copyMemory.

Doc from com.kenai.jffi.MemoryIO._copyMemory.

Copies contents of a native memory location to another native memory location.

Parameters
src:long

The source memory address.

dst:long

The destination memory address.

size:long

The number of bytes to copy.

getByteback to summary
public final byte getByte(long address)

Implements abstract com.kenai.jffi.MemoryIO.getByte.

Doc from com.kenai.jffi.MemoryIO.getByte.

Reads an 8 bit integer from a native memory location.

Parameters
address:long

The memory location to get the value from.

Returns:byte

A byte containing the value.

getByteArrayback to summary
public final void getByteArray(long address, byte[] data, int offset, int length)

Implements abstract com.kenai.jffi.MemoryIO.getByteArray.

Doc from com.kenai.jffi.MemoryIO.getByteArray.

Reads a java byte array from native memory.

Parameters
address:long

The native memory address to copy the array from.

data:byte[]

The java array to copy.

offset:int

The offset within the array to start copying to.

length:int

The number of array elements to copy.

getCharArrayback to summary
public final void getCharArray(long address, char[] data, int offset, int length)

Implements abstract com.kenai.jffi.MemoryIO.getCharArray.

Doc from com.kenai.jffi.MemoryIO.getCharArray.

Reads a java char array from native memory.

Parameters
address:long

The native memory address to copy the array from.

data:char[]

The java array to copy.

offset:int

The offset within the array to start copying to.

length:int

The number of array elements to copy.

getDoubleback to summary
public final double getDouble(long address)

Implements abstract com.kenai.jffi.MemoryIO.getDouble.

Doc from com.kenai.jffi.MemoryIO.getDouble.

Reads a 64 bit floating point value from a native memory location.

Parameters
address:long

The memory location to get the value from.

Returns:double

A double containing the value.

getDoubleArrayback to summary
public final void getDoubleArray(long address, double[] data, int offset, int length)

Implements abstract com.kenai.jffi.MemoryIO.getDoubleArray.

Doc from com.kenai.jffi.MemoryIO.getDoubleArray.

Reads a java double array from native memory.

Parameters
address:long

The native memory address to copy the array from.

data:double[]

The java array to copy.

offset:int

The offset within the array to start copying to.

length:int

The number of array elements to copy.

getFloatback to summary
public final float getFloat(long address)

Implements abstract com.kenai.jffi.MemoryIO.getFloat.

Doc from com.kenai.jffi.MemoryIO.getFloat.

Reads a 32 bit floating point value from a native memory location.

Parameters
address:long

The memory location to get the value from.

Returns:float

A float containing the value.

getFloatArrayback to summary
public final void getFloatArray(long address, float[] data, int offset, int length)

Implements abstract com.kenai.jffi.MemoryIO.getFloatArray.

Doc from com.kenai.jffi.MemoryIO.getFloatArray.

Reads a java float array from native memory.

Parameters
address:long

The native memory address to copy the array from.

data:float[]

The java array to copy.

offset:int

The offset within the array to start copying to.

length:int

The number of array elements to copy.

getIntback to summary
public final int getInt(long address)

Implements abstract com.kenai.jffi.MemoryIO.getInt.

Doc from com.kenai.jffi.MemoryIO.getInt.

Reads a 32 bit integer from a native memory location.

Parameters
address:long

The memory location to get the value from.

Returns:int

An int containing the value.

getIntArrayback to summary
public final void getIntArray(long address, int[] data, int offset, int length)

Implements abstract com.kenai.jffi.MemoryIO.getIntArray.

Doc from com.kenai.jffi.MemoryIO.getIntArray.

Reads a java int array from native memory.

Parameters
address:long

The native memory address to copy the array from.

data:int[]

The java array to copy.

offset:int

The offset within the array to start copying to.

length:int

The number of array elements to copy.

getLongback to summary
public final long getLong(long address)

Implements abstract com.kenai.jffi.MemoryIO.getLong.

Doc from com.kenai.jffi.MemoryIO.getLong.

Reads a 64 bit integer from a native memory location.

Parameters
address:long

The memory location to get the value from.

Returns:long

A long containing the value.

getLongArrayback to summary
public final void getLongArray(long address, long[] data, int offset, int length)

Implements abstract com.kenai.jffi.MemoryIO.getLongArray.

Doc from com.kenai.jffi.MemoryIO.getLongArray.

Reads a java long array from native memory.

Parameters
address:long

The native memory address to copy the array from.

data:long[]

The java array to copy.

offset:int

The offset within the array to start copying to.

length:int

The number of array elements to copy.

getShortback to summary
public final short getShort(long address)

Implements abstract com.kenai.jffi.MemoryIO.getShort.

Doc from com.kenai.jffi.MemoryIO.getShort.

Reads a 16 bit integer from a native memory location.

Parameters
address:long

The memory location to get the value from.

Returns:short

A short containing the value.

getShortArrayback to summary
public final void getShortArray(long address, short[] data, int offset, int length)

Implements abstract com.kenai.jffi.MemoryIO.getShortArray.

Doc from com.kenai.jffi.MemoryIO.getShortArray.

Reads a java short array from native memory.

Parameters
address:long

The native memory address to copy the array from.

data:short[]

The java array to copy.

offset:int

The offset within the array to start copying to.

length:int

The number of array elements to copy.

getStringLengthback to summary
public final long getStringLength(long address)

Implements abstract com.kenai.jffi.MemoryIO.getStringLength.

Doc from com.kenai.jffi.MemoryIO.getStringLength.

Gets the length of a native ascii or utf-8 string.

Parameters
address:long

The native address of the string.

Returns:long

The length of the string, in bytes.

getUnsafeback to summary
private static Object getUnsafe()
getZeroTerminatedByteArrayback to summary
public final byte[] getZeroTerminatedByteArray(long address)

Implements abstract com.kenai.jffi.MemoryIO.getZeroTerminatedByteArray.

Doc from com.kenai.jffi.MemoryIO.getZeroTerminatedByteArray.

Reads a byte array from native memory, stopping when a zero byte is found. This can be used to read ascii or utf-8 strings from native memory.

Parameters
address:long

The address to read the data from.

Returns:byte[]

The byte array containing a copy of the native data. Any zero byte is stripped from the end.

getZeroTerminatedByteArrayback to summary
public final byte[] getZeroTerminatedByteArray(long address, int maxlen)

Implements abstract com.kenai.jffi.MemoryIO.getZeroTerminatedByteArray.

Doc from com.kenai.jffi.MemoryIO.getZeroTerminatedByteArray.

Reads a byte array from native memory, stopping when a zero byte is found, or the maximum length is reached. This can be used to read ascii or utf-8 strings from native memory.

Parameters
address:long

The address to read the data from.

maxlen:int

The limit of the memory area to scan for a zero byte.

Returns:byte[]

The byte array containing a copy of the native data. Any zero byte is stripped from the end.

memchrback to summary
public final long memchr(long address, int value, long size)

Implements abstract com.kenai.jffi.MemoryIO.memchr.

Doc from com.kenai.jffi.MemoryIO.memchr.

Gets the address of a byte value in a native memory region.

Parameters
address:long

The native memory address to start searching.

value:int

The value to search for.

size:long

The size of the native memory region being searched.

Returns:long

The address of the value, or 0 (zero) if not found.

memcpyback to summary
public final void memcpy(long dst, long src, long size)

Implements abstract com.kenai.jffi.MemoryIO.memcpy.

Doc from com.kenai.jffi.MemoryIO.memcpy.

Copies bytes from one memory location to another. The memory areas

Parameters
dst:long

The destination memory address.

src:long

The source memory address.

size:long

The number of bytes to copy.

memmoveback to summary
public final void memmove(long dst, long src, long size)

Implements abstract com.kenai.jffi.MemoryIO.memmove.

Doc from com.kenai.jffi.MemoryIO.memmove.

Copies potentially overlapping memory areas.

Parameters
dst:long

The destination memory address.

src:long

The source memory address.

size:long

The number of bytes to copy.

putByteback to summary
public final void putByte(long address, byte value)

Implements abstract com.kenai.jffi.MemoryIO.putByte.

Doc from com.kenai.jffi.MemoryIO.putByte.

Writes an 8 bit integer value to a native memory location.

Parameters
address:long

The memory location to put the value.

value:byte

The value to write to memory.

putByteArrayback to summary
public final void putByteArray(long address, byte[] data, int offset, int length)

Implements abstract com.kenai.jffi.MemoryIO.putByteArray.

Doc from com.kenai.jffi.MemoryIO.putByteArray.

Writes a java byte array to native memory.

Parameters
address:long

The native memory address to copy the array to.

data:byte[]

The java array to copy.

offset:int

The offset within the array to start copying from.

length:int

The number of array elements to copy.

putCharArrayback to summary
public final void putCharArray(long address, char[] data, int offset, int length)

Implements abstract com.kenai.jffi.MemoryIO.putCharArray.

Doc from com.kenai.jffi.MemoryIO.putCharArray.

Writes a java char array to native memory.

Parameters
address:long

The native memory address to copy the array to.

data:char[]

The java array to copy.

offset:int

The offset within the array to start copying from.

length:int

The number of array elements to copy.

putDoubleback to summary
public final void putDouble(long address, double value)

Implements abstract com.kenai.jffi.MemoryIO.putDouble.

Doc from com.kenai.jffi.MemoryIO.putDouble.

Writes a 64 bit floating point value to a native memory location.

Parameters
address:long

The memory location to put the value.

value:double

The value to write to memory.

putDoubleArrayback to summary
public final void putDoubleArray(long address, double[] data, int offset, int length)

Implements abstract com.kenai.jffi.MemoryIO.putDoubleArray.

Doc from com.kenai.jffi.MemoryIO.putDoubleArray.

Writes a java double array to native memory.

Parameters
address:long

The native memory address to copy the array to.

data:double[]

The java array to copy.

offset:int

The offset within the array to start copying from.

length:int

The number of array elements to copy.

putFloatback to summary
public final void putFloat(long address, float value)

Implements abstract com.kenai.jffi.MemoryIO.putFloat.

Doc from com.kenai.jffi.MemoryIO.putFloat.

Writes a 32 bit floating point value to a native memory location.

Parameters
address:long

The memory location to put the value.

value:float

The value to write to memory.

putFloatArrayback to summary
public final void putFloatArray(long address, float[] data, int offset, int length)

Implements abstract com.kenai.jffi.MemoryIO.putFloatArray.

Doc from com.kenai.jffi.MemoryIO.putFloatArray.

Writes a java double array to native memory.

Parameters
address:long

The native memory address to copy the array to.

data:float[]

The java array to copy.

offset:int

The offset within the array to start copying from.

length:int

The number of array elements to copy.

putIntback to summary
public final void putInt(long address, int value)

Implements abstract com.kenai.jffi.MemoryIO.putInt.

Doc from com.kenai.jffi.MemoryIO.putInt.

Writes a 32 bit integer value to a native memory location.

Parameters
address:long

The memory location to put the value.

value:int

The value to write to memory.

putIntArrayback to summary
public final void putIntArray(long address, int[] data, int offset, int length)

Implements abstract com.kenai.jffi.MemoryIO.putIntArray.

Doc from com.kenai.jffi.MemoryIO.putIntArray.

Writes a java int array to native memory.

Parameters
address:long

The native memory address to copy the array to.

data:int[]

The java array to copy.

offset:int

The offset within the array to start copying from.

length:int

The number of array elements to copy.

putLongback to summary
public final void putLong(long address, long value)

Implements abstract com.kenai.jffi.MemoryIO.putLong.

Doc from com.kenai.jffi.MemoryIO.putLong.

Writes a 64 bit integer value to a native memory location.

Parameters
address:long

The memory location to put the value.

value:long

The value to write to memory.

putLongArrayback to summary
public final void putLongArray(long address, long[] data, int offset, int length)

Implements abstract com.kenai.jffi.MemoryIO.putLongArray.

Doc from com.kenai.jffi.MemoryIO.putLongArray.

Writes a java long array to native memory.

Parameters
address:long

The native memory address to copy the array to.

data:long[]

The java array to copy.

offset:int

The offset within the array to start copying from.

length:int

The number of array elements to copy.

putShortback to summary
public final void putShort(long address, short value)

Implements abstract com.kenai.jffi.MemoryIO.putShort.

Doc from com.kenai.jffi.MemoryIO.putShort.

Writes a 16 bit integer value to a native memory location.

Parameters
address:long

The memory location to put the value.

value:short

The value to write to memory.

putShortArrayback to summary
public final void putShortArray(long address, short[] data, int offset, int length)

Implements abstract com.kenai.jffi.MemoryIO.putShortArray.

Doc from com.kenai.jffi.MemoryIO.putShortArray.

Writes a java short array to native memory.

Parameters
address:long

The native memory address to copy the array to.

data:short[]

The java array to copy.

offset:int

The offset within the array to start copying from.

length:int

The number of array elements to copy.

putZeroTerminatedByteArrayback to summary
public final void putZeroTerminatedByteArray(long address, byte[] data, int offset, int length)

Implements abstract com.kenai.jffi.MemoryIO.putZeroTerminatedByteArray.

Doc from com.kenai.jffi.MemoryIO.putZeroTerminatedByteArray.

Copies a java byte array to native memory and appends a NUL terminating byte

Note

A total of length + 1 bytes is written to native memory.

Parameters
address:long

The address to copy to.

data:byte[]

The byte array to copy to native memory

offset:int

The offset within the byte array to begin copying from

length:int

The number of bytes to copy to native memory

setMemoryback to summary
public final void setMemory(long src, long size, byte value)

Implements abstract com.kenai.jffi.MemoryIO.setMemory.

Doc from com.kenai.jffi.MemoryIO.setMemory.

Sets a region of native memory to a specific byte value.

Parameters
src:long

The address of start of the native memory.

size:long

The number of bytes to set.

value:byte

The value to set the native memory to.

com.kenai.jffi back to summary

pack-priv Class UnsafeMemoryIO.UnsafeMemoryIO32

extends UnsafeMemoryIO
Class Inheritance

A 32 bit optimized implementation of MemoryIO using sun.misc.Unsafe

Field Summary

Inherited from com.kenai.jffi.UnsafeMemoryIO:
unsafe

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final long
getAddress(long
The memory location to get the value from.
address
)

Implements abstract com.kenai.jffi.MemoryIO.getAddress.

Reads a native memory address from a native memory location.
public final void
putAddress(long
The memory location to put the value.
address
,
long
The value to write to memory.
value
)

Implements abstract com.kenai.jffi.MemoryIO.putAddress.

Writes a native memory address value to a native memory location.
Inherited from com.kenai.jffi.UnsafeMemoryIO:
_copyMemorygetBytegetByteArraygetCharArraygetDoublegetDoubleArraygetFloatgetFloatArraygetIntgetIntArraygetLonggetLongArraygetShortgetShortArraygetStringLengthgetZeroTerminatedByteArraygetZeroTerminatedByteArraymemchrmemcpymemmoveputByteputByteArrayputCharArrayputDoubleputDoubleArrayputFloatputFloatArrayputIntputIntArrayputLongputLongArrayputShortputShortArrayputZeroTerminatedByteArraysetMemory

Constructor Detail

UnsafeMemoryIO32back to summary
pack-priv UnsafeMemoryIO32()

Method Detail

getAddressback to summary
public final long getAddress(long address)

Implements abstract com.kenai.jffi.MemoryIO.getAddress.

Doc from com.kenai.jffi.MemoryIO.getAddress.

Reads a native memory address from a native memory location.

Parameters
address:long

The memory location to get the value from.

Returns:long

A long containing the value.

putAddressback to summary
public final void putAddress(long address, long value)

Implements abstract com.kenai.jffi.MemoryIO.putAddress.

Doc from com.kenai.jffi.MemoryIO.putAddress.

Writes a native memory address value to a native memory location.

Parameters
address:long

The memory location to put the value.

value:long

The value to write to memory.

com.kenai.jffi back to summary

pack-priv Class UnsafeMemoryIO.UnsafeMemoryIO64

extends UnsafeMemoryIO
Class Inheritance

A 64 bit optimized implementation of MemoryIO using sun.misc.Unsafe

Field Summary

Inherited from com.kenai.jffi.UnsafeMemoryIO:
unsafe

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final long
getAddress(long
The memory location to get the value from.
address
)

Implements abstract com.kenai.jffi.MemoryIO.getAddress.

Reads a native memory address from a native memory location.
public final void
putAddress(long
The memory location to put the value.
address
,
long
The value to write to memory.
value
)

Implements abstract com.kenai.jffi.MemoryIO.putAddress.

Writes a native memory address value to a native memory location.
Inherited from com.kenai.jffi.UnsafeMemoryIO:
_copyMemorygetBytegetByteArraygetCharArraygetDoublegetDoubleArraygetFloatgetFloatArraygetIntgetIntArraygetLonggetLongArraygetShortgetShortArraygetStringLengthgetZeroTerminatedByteArraygetZeroTerminatedByteArraymemchrmemcpymemmoveputByteputByteArrayputCharArrayputDoubleputDoubleArrayputFloatputFloatArrayputIntputIntArrayputLongputLongArrayputShortputShortArrayputZeroTerminatedByteArraysetMemory

Constructor Detail

UnsafeMemoryIO64back to summary
pack-priv UnsafeMemoryIO64()

Method Detail

getAddressback to summary
public final long getAddress(long address)

Implements abstract com.kenai.jffi.MemoryIO.getAddress.

Doc from com.kenai.jffi.MemoryIO.getAddress.

Reads a native memory address from a native memory location.

Parameters
address:long

The memory location to get the value from.

Returns:long

A long containing the value.

putAddressback to summary
public final void putAddress(long address, long value)

Implements abstract com.kenai.jffi.MemoryIO.putAddress.

Doc from com.kenai.jffi.MemoryIO.putAddress.

Writes a native memory address value to a native memory location.

Parameters
address:long

The memory location to put the value.

value:long

The value to write to memory.