|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjnr.ffi.Pointer
jnr.ffi.provider.AbstractMemoryIO
public abstract class AbstractMemoryIO
Base implementations of some MemoryIO operations.
| Constructor Summary | |
|---|---|
protected |
AbstractMemoryIO(Runtime runtime)
|
| Method Summary | |
|---|---|
void |
checkBounds(long offset,
long size)
Checks that the memory region is within the bounds of this memory object |
protected static void |
checkBounds(long size,
long off,
long len)
|
long |
getAddress(long offset)
|
long |
getInt(Type type,
long offset)
Reads an integer value of the given type, at the given offset. |
long |
getLong(long offset)
Reads a long (64 bit) value at the given offset. |
long |
getNativeLong(long offset)
Reads a native long value at the given offset. |
Runtime |
getRuntime()
Gets the Runtime this Pointer instance belongs to. |
int |
indexOf(long offset,
byte value)
Returns the location of a byte value within the memory area represented by this Pointer. |
void |
putAddress(long offset,
Address value)
|
void |
putAddress(long offset,
long value)
|
void |
putInt(Type type,
long offset,
long value)
Writes an integer of a specific type, at the given offset. |
void |
putLong(long offset,
long value)
Writes a native long value at the given offset. |
void |
putNativeLong(long offset,
long value)
Writes a native long value at the given offset. |
AbstractMemoryIO |
slice(long offset)
Creates a new Pointer representing a sub-region of the memory
referred to by this Pointer. |
AbstractMemoryIO |
slice(long offset,
long size)
Creates a new Pointer representing a sub-region of the memory
referred to by this Pointer. |
void |
transferFrom(long offset,
Pointer other,
long otherOffset,
long count)
Bulk data transfer from one memory location to another. |
void |
transferTo(long offset,
Pointer other,
long otherOffset,
long count)
Bulk data transfer from one memory location to another. |
| Methods inherited from class jnr.ffi.Pointer |
|---|
address, array, arrayLength, arrayOffset, get, get, get, get, get, get, get, getByte, getDouble, getFloat, getInt, getLongLong, getNullTerminatedPointerArray, getNullTerminatedStringArray, getPointer, getPointer, getShort, getString, getString, hasArray, indexOf, isDirect, newIntPointer, put, put, put, put, put, put, put, putByte, putDouble, putFloat, putInt, putLongLong, putPointer, putShort, putString, setMemory, size, wrap, wrap, wrap |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractMemoryIO(Runtime runtime)
| Method Detail |
|---|
protected static final void checkBounds(long size,
long off,
long len)
public final Runtime getRuntime()
PointerRuntime this Pointer instance belongs to.
getRuntime in class PointerRuntime instance of this Pointer.
public int indexOf(long offset,
byte value)
PointerPointer.
indexOf in class Pointeroffset - the offset from the start of the memory location this Pointer represents to begin searching.value - the byte value to locate.
public long getAddress(long offset)
getAddress in class Pointer
public void putAddress(long offset,
long value)
putAddress in class Pointer
public void checkBounds(long offset,
long size)
Pointer
checkBounds in class Pointeroffset - the starting point within this memory region.size - the length of the memory region in bytes
public void putAddress(long offset,
Address value)
putAddress in class Pointerpublic final long getNativeLong(long offset)
Pointerlong value at the given offset.
A native long can be either 32 or 64 bits in size, depending
on the cpu architecture, and the C ABI in use.
For windows, a long is always 32 bits (4 bytes) in size, but on unix systems, a long on a 32bit system is 32 bits, and on a 64bit system, is 64 bits.
getNativeLong in class Pointeroffset - The offset from the start of the memory this Pointer represents at which the value will be read.
long value at the offset.NativeLong
public void putNativeLong(long offset,
long value)
Pointerlong value at the given offset.
A native long can be either 32 or 64 bits in size, depending
on the cpu architecture, and the C ABI in use.
For windows, a long is always 32 bits (4 bytes) in size, but on unix systems, a long on a 32bit system is 32 bits, and on a 64bit system, is 64 bits.
putNativeLong in class Pointeroffset - The offset from the start of the memory this Pointer represents at which the value will be written.value - the native long value to be written.public long getLong(long offset)
Pointerlong (64 bit) value at the given offset.
getLong in class Pointeroffset - The offset from the start of the memory this Pointer represents at which the value will be read.
long value at the offset.
public void putLong(long offset,
long value)
Pointernative long value at the given offset.
putLong in class Pointeroffset - The offset from the start of the memory this Pointer represents at which the value will be written.value - the long value to be written.
public void putInt(Type type,
long offset,
long value)
Pointer
putInt in class Pointeroffset - The offset from the start of the memory this Pointer represents at which the value will be written.value - the int value to be written.
public long getInt(Type type,
long offset)
Pointer
getInt in class Pointertype - Type of integer to read.offset - The offset from the start of the memory this Pointer represents at which the value will be read.
int value contained in the memory at the offset.public AbstractMemoryIO slice(long offset)
PointerPointer representing a sub-region of the memory
referred to by this Pointer.
slice in class Pointeroffset - the offset from the start of the memory this Pointer
represents at which the new Pointer will start.
Pointer instance representing the new sub-region.
public AbstractMemoryIO slice(long offset,
long size)
PointerPointer representing a sub-region of the memory
referred to by this Pointer.
slice in class Pointeroffset - the offset from the start of the memory this Pointer
represents at which the new Pointer will start.size - the maximum size of the memory sub-region.
Pointer instance representing the new sub-region.
public void transferTo(long offset,
Pointer other,
long otherOffset,
long count)
Pointer
transferTo in class Pointeroffset - the offset from the start of the memory location this Pointer represents to begin copying from.other - the destination memory location to transfer data to.otherOffset - the offset from the start of the memory location the destination Pointer represents to begin copying to.count - the number of bytes to transfer.
public void transferFrom(long offset,
Pointer other,
long otherOffset,
long count)
Pointer
transferFrom in class Pointeroffset - the offset from the start of the memory location this Pointer represents to begin copying to.other - the destination memory location to transfer data from.otherOffset - the offset from the start of the memory location the destination Pointer represents to begin copying from.count - the number of bytes to transfer.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||