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 voidclose()tidy up when snapshot no longer required<A> AgetAddon(Class<A> addon)Returns extra data to be provided byISnapshot.getSnapshotAddons(Class addon).voidopen(ISnapshot snapshot)Open the dump file associated with the snapshotIObjectread(int objectId, ISnapshot snapshot)Get detailed information about an objectlong[]readObjectArrayContent(ObjectArrayImpl array, int offset, int length)Read some of the contents of an arrayObjectreadPrimitiveArrayContent(PrimitiveArrayImpl array, int offset, int length)Read some of the contents of an array
-
-
-
Method Detail
-
close
public void close() throws IOExceptionDescription copied from interface:IObjectReadertidy up when snapshot no longer required- Specified by:
closein 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:
getAddonin 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:IObjectReaderOpen the dump file associated with the snapshot- Specified by:
openin 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:IObjectReaderGet detailed information about an object- Specified by:
readin 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:
readPrimitiveArrayContentin 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:
readObjectArrayContentin 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
-
-