org.eclipse.mat.hprof
Class HprofHeapObjectReader

java.lang.Object
  extended by org.eclipse.mat.hprof.HprofHeapObjectReader
All Implemented Interfaces:
IObjectReader

public class HprofHeapObjectReader
extends java.lang.Object
implements IObjectReader


Field Summary
static java.lang.String VERSION_PROPERTY
           
 
Constructor Summary
HprofHeapObjectReader()
           
 
Method Summary
 void close()
          tidy up when snapshot no longer required
<A> A
getAddon(java.lang.Class<A> addon)
          Returns extra data to be provided by ISnapshot#getSnapshotAddons(Class addon).
 void open(ISnapshot snapshot)
          Open the dump file associated with the snapshot
 IObject read(int objectId, ISnapshot snapshot)
          Get detailed information about an object
 long[] readObjectArrayContent(ObjectArrayImpl array, int offset, int length)
          Get detailed information about a object array
 java.lang.Object readPrimitiveArrayContent(PrimitiveArrayImpl array, int offset, int length)
          Get detailed information about a primitive array
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION_PROPERTY

public static final java.lang.String VERSION_PROPERTY
See Also:
Constant Field Values
Constructor Detail

HprofHeapObjectReader

public HprofHeapObjectReader()
Method Detail

open

public void open(ISnapshot snapshot)
          throws java.io.IOException
Description copied from interface: IObjectReader
Open the dump file associated with the snapshot

Specified by:
open in interface IObjectReader
Throws:
java.io.IOException

readObjectArrayContent

public long[] readObjectArrayContent(ObjectArrayImpl array,
                                     int offset,
                                     int length)
                              throws java.io.IOException,
                                     SnapshotException
Description copied from interface: IObjectReader
Get detailed information about a object array

Specified by:
readObjectArrayContent in interface IObjectReader
offset - where in the array to start
length - how much to read
Returns:
an array of object addresses, with 0 for nulls
Throws:
java.io.IOException
SnapshotException

readPrimitiveArrayContent

public java.lang.Object readPrimitiveArrayContent(PrimitiveArrayImpl array,
                                                  int offset,
                                                  int length)
                                           throws java.io.IOException,
                                                  SnapshotException
Description copied from interface: IObjectReader
Get detailed information about a primitive array

Specified by:
readPrimitiveArrayContent in interface IObjectReader
Parameters:
array - the array
offset - where in the array to start
length - how much to read
Returns:
a byte[], short[], int[], long[], boolean[], char[], float[], double[]
Throws:
java.io.IOException
SnapshotException

read

public IObject read(int objectId,
                    ISnapshot snapshot)
             throws SnapshotException,
                    java.io.IOException
Description copied from interface: IObjectReader
Get detailed information about an object

Specified by:
read in interface IObjectReader
Parameters:
objectId - the object id
snapshot - the snapshot
Returns:
an IObject such as InstanceImpl, ObjectArrayImpl, PrimitiveArrayImpl, ClassLoaderImpl
Throws:
SnapshotException
java.io.IOException

getAddon

public <A> A getAddon(java.lang.Class<A> addon)
           throws SnapshotException
Returns extra data to be provided by ISnapshot#getSnapshotAddons(Class addon). Also can be returned via Argument.

Specified by:
getAddon in interface IObjectReader
Parameters:
addon - the type of the extra data required from the dump. HprofHeapObjectReader can be extended using an IRuntimeEnhancer extension to return extra data.
Returns:
the extra data
Throws:
SnapshotException
See Also:
IObjectReader.getAddon(Class)

close

public void close()
           throws java.io.IOException
Description copied from interface: IObjectReader
tidy up when snapshot no longer required

Specified by:
close in interface IObjectReader
Throws:
java.io.IOException