Package org.eclipse.mat.dtfj
Class DTFJHeapObjectReader
- java.lang.Object
-
- org.eclipse.mat.dtfj.DTFJHeapObjectReader
-
- All Implemented Interfaces:
IObjectReader
public class DTFJHeapObjectReader extends Object implements IObjectReader
Reads details of an object from a DTFJ dump.
-
-
Constructor Summary
Constructors Constructor Description DTFJHeapObjectReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
tidy up when snapshot no longer required<A> A
getAddon(Class<A> addon)
Returns extra data to be provided byISnapshot.getSnapshotAddons(Class addon)
.void
open(ISnapshot snapshot)
Open the dump file associated with the snapshotIObject
read(int objectId, ISnapshot snapshot)
Get detailed information about an objectlong[]
readObjectArrayContent(ObjectArrayImpl array, int offset, int length)
Read some of the contents of an arrayObject
readPrimitiveArrayContent(PrimitiveArrayImpl array, int offset, int length)
Read some of the contents of an array
-
-
-
Method Detail
-
close
public void close() throws IOException
Description copied from interface:IObjectReader
tidy up when snapshot no longer required- Specified by:
close
in interfaceIObjectReader
- Throws:
IOException
- should not normally occur
-
getAddon
public <A> A getAddon(Class<A> addon) throws SnapshotException
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:
IObjectReader.getAddon(Class)
-
open
public void open(ISnapshot snapshot) throws IOException, SnapshotException
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
public IObject read(int objectId, ISnapshot snapshot) throws SnapshotException, IOException
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
-
-