Top Inners Fields Constructors Methods
jnr.ffi.provider

public abstract Class AbstractArrayMemoryIO

extends AbstractMemoryIO
Class Inheritance
Known Direct Subclasses
jnr.ffi.provider.jffi.ArrayMemoryIO
Imports
jnr.ffi.Runtime, jnr.ffi.util.BufferUtil, java.nio.ByteBuffer, .ByteOrder, java.nio.charset.Charset, java.util.Arrays

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected abstract static class
private static class
private static class
private abstract static class
private static class
private static class
private abstract static class

Field Summary

Modifier and TypeField and Description
protected final byte[]
private final AbstractArrayMemoryIO.ArrayIO
protected final int
protected final int

Constructor Summary

AccessConstructor and Description
protected
AbstractArrayMemoryIO(Runtime runtime, byte[] buffer, int offset, int length)

protected
AbstractArrayMemoryIO(Runtime runtime, byte[] buffer)

protected
AbstractArrayMemoryIO(Runtime runtime, int size)

Method Summary

Modifier and TypeMethod and Description
public final byte[]
array()

Implements abstract jnr.ffi.Pointer.array.

Returns the array that backs this pointer.
public final int
arrayLength()

Implements abstract jnr.ffi.Pointer.arrayLength.

Returns the length of this pointer's backing array that is used by this pointer.
public final int
arrayOffset()

Implements abstract jnr.ffi.Pointer.arrayOffset.

Returns the offset within this pointer's backing array of the first element.
public final void
public final void
get(long
the offset from the start of the memory this Pointer represents at which the first value will be read.
offset
,
byte[]
the array into which values are to be stored.
dst
,
int
the start index in the dst array to begin storing the values.
off
,
int
the number of values to be read.
len
)

Implements abstract jnr.ffi.Pointer.get.

Bulk get method for multiple byte values.
public final void
get(long
The offset from the start of the memory this Pointer represents at which the first value will be read.
offset
,
short[]
The array into which values are to be stored.
dst
,
int
the start index in the dst array to begin storing the values.
off
,
int
the number of values to be read.
len
)

Implements abstract jnr.ffi.Pointer.get.

Bulk get method for multiple short values.
public final void
get(long
The offset from the start of the memory this Pointer represents at which the first value will be read.
offset
,
int[]
The array into which values are to be stored.
dst
,
int
the start index in the dst array to begin storing the values.
off
,
int
the number of values to be read.
len
)

Implements abstract jnr.ffi.Pointer.get.

Bulk get method for multiple int values.
public final void
get(long
The offset from the start of the memory this Pointer represents at which the first value will be read.
offset
,
long[]
The array into which values are to be stored.
dst
,
int
the start index in the dst array to begin storing the values.
off
,
int
the number of values to be read.
len
)

Implements abstract jnr.ffi.Pointer.get.

Bulk get method for multiple long values.
public final void
get(long
The offset from the start of the memory this Pointer represents at which the first value will be read.
offset
,
float[]
The array into which values are to be stored.
dst
,
int
the start index in the dst array to begin storing the values.
off
,
int
the number of values to be read.
len
)

Implements abstract jnr.ffi.Pointer.get.

Bulk get method for multiple float values.
public final void
get(long
The offset from the start of the memory this Pointer represents at which the first value will be read.
offset
,
double[]
The array into which values are to be stored.
dst
,
int
the start index in the dst array to begin storing the values.
off
,
int
the number of values to be read.
len
)

Implements abstract jnr.ffi.Pointer.get.

Bulk get method for multiple double values.
public final long
getAddress(long
The offset from the start of the memory this Pointer represents at which the value will be read.
offset
)

Overrides jnr.ffi.provider.AbstractMemoryIO.getAddress.

Reads a native memory address value at the given offset.
protected final AbstractArrayMemoryIO.ArrayIO
public final byte
getByte(long
The offset from the start of the memory this Pointer represents at which the value will be read.
offset
)

Implements abstract jnr.ffi.Pointer.getByte.

Reads an byte (8 bit) value at the given offset.
public final double
getDouble(long
The offset from the start of the memory this Pointer represents at which the value will be read.
offset
)

Implements abstract jnr.ffi.Pointer.getDouble.

Reads a double (64 bit) value at the given offset.
public final float
getFloat(long
The offset from the start of the memory this Pointer represents at which the value will be read.
offset
)

Implements abstract jnr.ffi.Pointer.getFloat.

Reads a float (32 bit) value at the given offset.
public final int
getInt(long
The offset from the start of the memory this Pointer represents at which the value will be read.
offset
)

Implements abstract jnr.ffi.Pointer.getInt.

Reads an int (32 bit) value at the given offset.
public final long
getLongLong(long
The offset from the start of the memory this Pointer represents at which the value will be read.
offset
)

Implements abstract jnr.ffi.Pointer.getLongLong.

Reads a long (64 bit) value at the given offset.
public final short
getShort(long
The offset from the start of the memory this Pointer represents at which the value will be read.
offset
)

Implements abstract jnr.ffi.Pointer.getShort.

Reads a short (16 bit) value at the given offset.
public String
getString(long
the offset from the start of the memory this Pointer represents at which the value will be read.
offset
)

Implements abstract jnr.ffi.Pointer.getString.

Reads an String value at the given offset.
public String
getString(long
the offset from the start of the memory this Pointer represents at which the value will be read.
offset
,
int
the maximum size of memory to search for a NUL byte.
maxLength
,
Charset
the Charset to use to decode the string.
cs
)

Implements abstract jnr.ffi.Pointer.getString.

Reads a String value at the given offset, using a specific Charset
public final boolean
hasArray()

Implements abstract jnr.ffi.Pointer.hasArray.

Indicates whether this Pointer instance is backed by an array.
protected final int
index(long off)

public final int
indexOf(long
the offset from the start of the memory location this Pointer represents to begin searching.
offset
,
byte
the byte value to locate.
value
)

Overrides jnr.ffi.provider.AbstractMemoryIO.indexOf.

Returns the location of a byte value within the memory area represented by this Pointer.
public final int
indexOf(long
the offset from the start of the memory location this Pointer represents to begin searching.
offset
,
byte
the byte value to locate.
value
,
int
the maximum number of bytes to search for the desired value.
maxlen
)

Implements abstract jnr.ffi.Pointer.indexOf.

Returns the location of a byte value within the memory area represented by this Pointer.
public final boolean
public final int
public final int
public final void
put(long
the offset from the start of the memory this Pointer represents at which the first value will be written.
offset
,
byte[]
the array to get values from.
src
,
int
the start index in the dst array to begin reading values.
off
,
int
the number of values to be written.
len
)

Implements abstract jnr.ffi.Pointer.put.

Bulk put method for multiple byte values.
public final void
put(long
the offset from the start of the memory this Pointer represents at which the first value will be written.
offset
,
short[]
the array to get values from.
src
,
int
the start index in the dst array to begin reading values.
off
,
int
the number of values to be written.
len
)

Implements abstract jnr.ffi.Pointer.put.

Bulk put method for multiple short values.
public final void
put(long
the offset from the start of the memory this Pointer represents at which the first value will be written.
offset
,
int[]
the array to get values from.
src
,
int
the start index in the dst array to begin reading values.
off
,
int
the number of values to be written.
len
)

Implements abstract jnr.ffi.Pointer.put.

Bulk put method for multiple int values.
public final void
put(long
the offset from the start of the memory this Pointer represents at which the first value will be written.
offset
,
long[]
the array to get values from.
src
,
int
the start index in the dst array to begin reading values.
off
,
int
the number of values to be written.
len
)

Implements abstract jnr.ffi.Pointer.put.

Bulk put method for multiple long values.
public final void
put(long
the offset from the start of the memory this Pointer represents at which the first value will be written.
offset
,
float[]
the array to get values from.
src
,
int
the start index in the dst array to begin reading values.
off
,
int
the number of values to be written.
len
)

Implements abstract jnr.ffi.Pointer.put.

Bulk put method for multiple float values.
public final void
put(long
the offset from the start of the memory this Pointer represents at which the first value will be written.
offset
,
double[]
the array to get values from.
src
,
int
the start index in the dst array to begin reading values.
off
,
int
the number of values to be written.
len
)

Implements abstract jnr.ffi.Pointer.put.

Bulk put method for multiple double values.
public final void
putAddress(long
The offset from the start of the memory this Pointer represents at which the value will be written.
offset
,
long
The native address value to be written.
value
)

Overrides jnr.ffi.provider.AbstractMemoryIO.putAddress.

Writes a native memory address value at the given offset.
public final void
putByte(long
The offset from the start of the memory this Pointer represents at which the value will be written.
offset
,
byte
the byte value to be written.
value
)

Implements abstract jnr.ffi.Pointer.putByte.

Writes a byte (8 bit) value at the given offset.
public final void
putDouble(long
The offset from the start of the memory this Pointer represents at which the value will be written.
offset
,
double
the double value to be written.
value
)

Implements abstract jnr.ffi.Pointer.putDouble.

Writes a double (64 bit, double precision) value at the given offset.
public final void
putFloat(long
The offset from the start of the memory this Pointer represents at which the value will be written.
offset
,
float
the float value to be written.
value
)

Implements abstract jnr.ffi.Pointer.putFloat.

Writes a float (32 bit, single precision) value at the given offset.
public final void
putInt(long
The offset from the start of the memory this Pointer represents at which the value will be written.
offset
,
int
the int value to be written.
value
)

Implements abstract jnr.ffi.Pointer.putInt.

Writes an int (32 bit) value at the given offset.
public final void
putLongLong(long
The offset from the start of the memory this Pointer represents at which the value will be written.
offset
,
long
the long value to be written.
value
)

Implements abstract jnr.ffi.Pointer.putLongLong.

Writes a long (64 bit) value at the given offset.
public final void
putShort(long
The offset from the start of the memory this Pointer represents at which the value will be written.
offset
,
short
the short value to be written.
value
)

Implements abstract jnr.ffi.Pointer.putShort.

Writes a short (16 bit) value at the given offset.
public void
putString(long
the offset from the start of the memory this Pointer represents at which the value will be written.
offset
,
String
the string to be written.
string
,
int
the maximum size of memory to use to store the string.
maxLength
,
Charset
the Charset to use to decode the string.
cs
)

Implements abstract jnr.ffi.Pointer.putString.

Writes a String value at the given offset, using a specific Charset
public void
putZeroTerminatedByteArray(long offset, byte[] src, int off, int len)

protected final int
remaining(long offset)

public final void
setMemory(long
the offset from the start of the memory location this Pointer represents to begin writing to.
offset
,
long
the number of bytes to set to the value.
size
,
byte
the value to set each byte to.
value
)

Implements abstract jnr.ffi.Pointer.setMemory.

Sets the value of each byte in the memory area represented by this Pointer.
public final long
size()

Implements abstract jnr.ffi.Pointer.size.

Gets the size of this memory object in bytes (optional operation).
Inherited from jnr.ffi.provider.AbstractMemoryIO:
checkBoundscheckBoundsgetIntgetLonggetNativeLongputAddressputIntputLongputNativeLongsliceslicetransferFromtransferTo