com.ibm.dtfj.image
Interface ImagePointer
- public interface ImagePointer
Represents an address in image memory.
getAddress
public long getAddress()
- Returns:
- the unwrapped address, represented as a 64-bit integer
Use caution when comparing addresses, as some addresses may be
negative.
Note that on segmented memory architectures, it may not be
possible to represent all addresses accurately as integers
getAddressSpace
public ImageAddressSpace getAddressSpace()
- Returns:
- the address space to which this pointer belongs
add
public ImagePointer add(long offset)
- Parameters:
offset
-
- Returns:
- a new ImagePointer based at getAddress() + offset
isExecutable
public boolean isExecutable()
throws DataUnavailable
- Returns:
- true if this memory address is within an executable page
- Throws:
DataUnavailable
isReadOnly
public boolean isReadOnly()
throws DataUnavailable
- Returns:
- true if write access to this memory address was disabled in the image
- Throws:
DataUnavailable
isShared
public boolean isShared()
throws DataUnavailable
- Returns:
- true if this memory address is shared between processes
- Throws:
DataUnavailable
getPointerAt
public ImagePointer getPointerAt(long index)
throws MemoryAccessException,
CorruptDataException
- Parameters:
index
-
- Returns:
- the 32 or 64-bit pointer stored at getAddress() + index * sizeof(void*)
- Throws:
MemoryAccessException
- if the memory cannot be read
CorruptDataException
- if the memory should be in the image, but is missing or corrupted
getLongAt
public long getLongAt(long index)
throws MemoryAccessException,
CorruptDataException
- Parameters:
index
-
- Returns:
- the 64-bit long stored at getAddress() + index * sizeof(jlong)
- Throws:
MemoryAccessException
- if the memory cannot be read
CorruptDataException
- if the memory should be in the image, but is missing or corrupted
getIntAt
public int getIntAt(long index)
throws MemoryAccessException,
CorruptDataException
- Parameters:
index
-
- Returns:
- the 32-bit int stored at getAddress() + index * sizeof(jint)
- Throws:
MemoryAccessException
- if the memory cannot be read
CorruptDataException
- if the memory should be in the image, but is missing or corrupted
getShortAt
public short getShortAt(long index)
throws MemoryAccessException,
CorruptDataException
- Parameters:
index
-
- Returns:
- the 16-bit short stored at getAddress() + index * sizeof(jshort)
- Throws:
MemoryAccessException
- if the memory cannot be read
CorruptDataException
- if the memory should be in the image, but is missing or corrupted
getByteAt
public byte getByteAt(long index)
throws MemoryAccessException,
CorruptDataException
- Parameters:
index
-
- Returns:
- the 8-bit byte stored at getAddress() + index * sizeof(jbyte)
- Throws:
MemoryAccessException
- if the memory cannot be read
CorruptDataException
- if the memory should be in the image, but is missing or corrupted
getFloatAt
public float getFloatAt(long index)
throws MemoryAccessException,
CorruptDataException
- Parameters:
index
-
- Returns:
- the 32-bit float stored at getAddress() + index * sizeof(jfloat)
- Throws:
MemoryAccessException
- if the memory cannot be read
CorruptDataException
- if the memory should be in the image, but is missing or corrupted
getDoubleAt
public double getDoubleAt(long index)
throws MemoryAccessException,
CorruptDataException
- Parameters:
index
-
- Returns:
- the 64-bit double stored at getAddress() + index * sizeof(jdouble)
- Throws:
MemoryAccessException
- if the memory cannot be read
CorruptDataException
- if the memory should be in the image, but is missing or corrupted
equals
public boolean equals(java.lang.Object obj)
- Parameters:
obj
-
- Returns:
- True obj refers to the same Image Pointer in the image
hashCode
public int hashCode()