public class HprofHeapObjectReader extends Object implements IObjectReader
Modifier and Type | Field and Description |
---|---|
static String |
VERSION_PROPERTY |
Constructor and Description |
---|
HprofHeapObjectReader() |
Modifier and Type | Method and Description |
---|---|
void |
close()
tidy up when snapshot no longer required
|
<A> A |
getAddon(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
|
Object |
readPrimitiveArrayContent(PrimitiveArrayImpl array,
int offset,
int length)
Get detailed information about a primitive array
|
public static final String VERSION_PROPERTY
public void open(ISnapshot snapshot) throws IOException
IObjectReader
open
in interface IObjectReader
IOException
public long[] readObjectArrayContent(ObjectArrayImpl array, int offset, int length) throws IOException, SnapshotException
IObjectReader
readObjectArrayContent
in interface IObjectReader
offset
- where in the array to startlength
- how much to readIOException
SnapshotException
public Object readPrimitiveArrayContent(PrimitiveArrayImpl array, int offset, int length) throws IOException, SnapshotException
IObjectReader
readPrimitiveArrayContent
in interface IObjectReader
array
- the arrayoffset
- where in the array to startlength
- how much to readIOException
SnapshotException
public IObject read(int objectId, ISnapshot snapshot) throws SnapshotException, IOException
IObjectReader
read
in interface IObjectReader
objectId
- the object idsnapshot
- the snapshotInstanceImpl
, ObjectArrayImpl
, PrimitiveArrayImpl
, ClassLoaderImpl
SnapshotException
IOException
public <A> A getAddon(Class<A> addon) throws SnapshotException
ISnapshot.getSnapshotAddons(Class addon)
. Also can be returned
via Argument
.getAddon
in interface IObjectReader
addon
- the type of the extra data required from the dump.
HprofHeapObjectReader can be extended using an
IRuntimeEnhancer
extension to return extra data.SnapshotException
IObjectReader.getAddon(Class)
public void close() throws IOException
IObjectReader
close
in interface IObjectReader
IOException