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, wrap
protected AbstractMemoryIO(Runtime runtime, long address, boolean isDirect)
protected static void checkBounds(long size, long off, long len)
public int indexOf(long offset, byte value)
Pointer
Pointer
.indexOf
in class Pointer
offset
- 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)
Pointer
A native address can be either 32 or 64 bits in size, depending on the cpu architecture.
getAddress
in class Pointer
offset
- The offset from the start of the memory this Pointer
represents at which the value will be read.Address
public void putAddress(long offset, long value)
Pointer
A native address can be either 32 or 64 bits in size, depending on the cpu architecture.
putAddress
in class Pointer
offset
- 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.Address
public void checkBounds(long offset, long size)
Pointer
checkBounds
in class Pointer
offset
- the starting point within this memory region.size
- the length of the memory region in bytespublic void putAddress(long offset, Address value)
Pointer
A native address can be either 32 or 64 bits in size, depending on the cpu architecture.
putAddress
in class Pointer
offset
- 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.Address
public final long getNativeLong(long offset)
Pointer
long
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 Pointer
offset
- 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)
Pointer
long
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 Pointer
offset
- 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)
Pointer
long
(64 bit) value at the given offset.public void putLong(long offset, long value)
Pointer
native long
value at the given offset.public void putInt(Type type, long offset, long value)
Pointer
public long getInt(Type type, long offset)
Pointer
public AbstractMemoryIO slice(long offset)
Pointer
Pointer
representing a sub-region of the memory
referred to by this Pointer
.public AbstractMemoryIO slice(long offset, long size)
Pointer
Pointer
representing a sub-region of the memory
referred to by this Pointer
.public void transferTo(long offset, Pointer other, long otherOffset, long count)
Pointer
transferTo
in class Pointer
offset
- 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 Pointer
offset
- 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.