public abstract class AbstractMemoryIO extends Pointer
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMemoryIO(Runtime runtime,
long address,
boolean isDirect) |
| Modifier and Type | Method and Description |
|---|---|
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)
Reads a native memory address value at the given 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. |
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)
Writes a native memory address value at the given offset.
|
void |
putAddress(long offset,
long value)
Writes a native memory address value at the given offset.
|
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.
|
address, array, arrayLength, arrayOffset, get, get, get, get, get, get, get, getByte, getDouble, getFloat, getInt, getLongLong, getNullTerminatedPointerArray, getNullTerminatedStringArray, getPointer, getPointer, getRuntime, getShort, getString, getString, hasArray, indexOf, isDirect, newIntPointer, put, put, put, put, put, put, put, putByte, putDouble, putFloat, putInt, putLongLong, putPointer, putShort, putString, setMemory, size, toString, wrap, wrap, wrapprotected AbstractMemoryIO(Runtime runtime, long address, boolean isDirect)
protected static void checkBounds(long size,
long off,
long len)
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)
PointerA native address can be either 32 or 64 bits in size, depending on the cpu architecture.
getAddress in class Pointeroffset - The offset from the start of the memory this Pointer represents at which the value will be read.Addresspublic void putAddress(long offset,
long value)
PointerA native address can be either 32 or 64 bits in size, depending on the cpu architecture.
putAddress in class Pointeroffset - The offset from the start of the memory this Pointer represents at which the value will be written.value - The native address value to be written.Addresspublic void checkBounds(long offset,
long size)
PointercheckBounds in class Pointeroffset - the starting point within this memory region.size - the length of the memory region in bytespublic void putAddress(long offset,
Address value)
PointerA native address can be either 32 or 64 bits in size, depending on the cpu architecture.
putAddress in class Pointeroffset - The offset from the start of the memory this Pointer represents at which the value will be written.value - The native address value to be written.Addresspublic 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.NativeLongpublic 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.public void putLong(long offset,
long value)
Pointernative long value at the given offset.public void putInt(Type type, long offset, long value)
Pointerpublic long getInt(Type type, long offset)
Pointerpublic AbstractMemoryIO slice(long offset)
PointerPointer representing a sub-region of the memory
referred to by this Pointer.public AbstractMemoryIO slice(long offset, long size)
PointerPointer representing a sub-region of the memory
referred to by this Pointer.public void transferTo(long offset,
Pointer other,
long otherOffset,
long count)
PointertransferTo 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)
PointertransferFrom 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.Copyright © 2017. All rights reserved.