Package org.eclipse.mat.dtfj
Class DTFJHeapObjectReader
java.lang.Object
org.eclipse.mat.dtfj.DTFJHeapObjectReader
- All Implemented Interfaces:
IObjectReader
Reads details of an object from a DTFJ dump.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
tidy up when snapshot no longer required<A> A
Returns extra data to be provided byISnapshot.getSnapshotAddons(Class addon)
.void
Open the dump file associated with the snapshotGet detailed information about an objectlong[]
readObjectArrayContent
(ObjectArrayImpl array, int offset, int length) Read some of the contents of an arrayreadPrimitiveArrayContent
(PrimitiveArrayImpl array, int offset, int length) Read some of the contents of an array
-
Constructor Details
-
DTFJHeapObjectReader
public DTFJHeapObjectReader()
-
-
Method Details
-
close
Description copied from interface:IObjectReader
tidy up when snapshot no longer required- Specified by:
close
in interfaceIObjectReader
- Throws:
IOException
- should not normally occur
-
getAddon
Returns extra data to be provided byISnapshot.getSnapshotAddons(Class addon)
. Also can be returned viaArgument
.- Specified by:
getAddon
in interfaceIObjectReader
- Type Parameters:
A
- used to set the return type- Parameters:
addon
- the type of the extra data required from the dump Types supported by DTFJHeapObjectReader include- Returns:
- the extra data
- Throws:
SnapshotException
- an IO problem or unexpected data in the dump- See Also:
-
open
Description copied from interface:IObjectReader
Open the dump file associated with the snapshot- Specified by:
open
in interfaceIObjectReader
- Parameters:
snapshot
- the snapshot- Throws:
IOException
- an IO problem, or corrupt indexes or unexpected data in the dumpSnapshotException
- some other problem
-
read
Description copied from interface:IObjectReader
Get detailed information about an object- Specified by:
read
in interfaceIObjectReader
- Parameters:
objectId
- the object idsnapshot
- the snapshot- Returns:
- an IObject such as
InstanceImpl
,ObjectArrayImpl
,PrimitiveArrayImpl
,ClassLoaderImpl
- Throws:
SnapshotException
- some other problem such as where the object is incompatible with the snapshotIOException
- an IO problem or unexpected data in the dump
-
readPrimitiveArrayContent
public Object readPrimitiveArrayContent(PrimitiveArrayImpl array, int offset, int length) throws IOException, SnapshotException Read some of the contents of an array- Specified by:
readPrimitiveArrayContent
in interfaceIObjectReader
- Parameters:
array
- The MAT array to be readoffset
- the offset into the arraylength
- the number of items to be read- Returns:
- A primitive array holding the items
- Throws:
IOException
- an IO problem or unexpected data in the dumpSnapshotException
- some other problem such as where the object is incompatible with the snapshot
-
readObjectArrayContent
public long[] readObjectArrayContent(ObjectArrayImpl array, int offset, int length) throws IOException, SnapshotException Read some of the contents of an array- Specified by:
readObjectArrayContent
in interfaceIObjectReader
- Parameters:
array
- The MAT array to be readoffset
- the offset into the arraylength
- the number of items to be read- Returns:
- A array of longs holding the addresses of the objects in the array
- Throws:
IOException
- an IO problem or unexpected data in the dumpSnapshotException
- some other problem such as where the object is incompatible with the snapshot
-