Package org.eclipse.mat.hprof
Class HprofHeapObjectReader
java.lang.Object
org.eclipse.mat.hprof.HprofHeapObjectReader
- All Implemented Interfaces:
IObjectReader
-
Field Summary
-
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) Get detailed information about a object arrayreadPrimitiveArrayContent
(PrimitiveArrayImpl array, int offset, int length) Get detailed information about a primitive array
-
Field Details
-
VERSION_PROPERTY
- See Also:
-
HPROF_LENGTH_PROPERTY
- See Also:
-
HPROF_HEAP_START
- See Also:
-
-
Constructor Details
-
HprofHeapObjectReader
public HprofHeapObjectReader()
-
-
Method Details
-
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 dump
-
readObjectArrayContent
public long[] readObjectArrayContent(ObjectArrayImpl array, int offset, int length) throws IOException, SnapshotException Description copied from interface:IObjectReader
Get detailed information about a object array- Specified by:
readObjectArrayContent
in interfaceIObjectReader
- Parameters:
array
- the arrayoffset
- where in the array to startlength
- how much to read- Returns:
- an array of object addresses, with 0 for nulls
- Throws:
IOException
- an IO problem or unexpected data in the dumpSnapshotException
- some other problem such as where the object is incompatible with the snapshot
-
readPrimitiveArrayContent
public Object readPrimitiveArrayContent(PrimitiveArrayImpl array, int offset, int length) throws IOException, SnapshotException Description copied from interface:IObjectReader
Get detailed information about a primitive array- Specified by:
readPrimitiveArrayContent
in interfaceIObjectReader
- Parameters:
array
- the arrayoffset
- where in the array to startlength
- how much to read- Returns:
- a byte[], short[], int[], long[], boolean[], char[], float[], double[]
- Throws:
IOException
- an IO problem or unexpected data in the dumpSnapshotException
- some other problem such as where the object is incompatible with the snapshot
-
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
-
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. HprofHeapObjectReader can be extended using anIRuntimeEnhancer
extension to return extra data.- Returns:
- the extra data
- Throws:
SnapshotException
- an IO problem or unexpected data in the dump- See Also:
-
close
Description copied from interface:IObjectReader
tidy up when snapshot no longer required- Specified by:
close
in interfaceIObjectReader
- Throws:
IOException
- should not normally occur
-