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
`DTFJHeapObjectReader()`

### Method Summary

All Methods Instance Methods Concrete Methods
`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)` Read some of the contents of an array
`Object` `readPrimitiveArrayContent​(PrimitiveArrayImpl array, int offset, int length)` Read some of the contents of an array

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DTFJHeapObjectReader

    public DTFJHeapObjectReader()

### Method Detail

#### close

    public void close()
               throws IOException

Description copied from interface: `IObjectReader`
tidy up when snapshot no longer required

Specified by:
  `close` in interface `IObjectReader`
Throws:
  `IOException` - should not normally occur

#### getAddon

    public <A> A getAddon​(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 Types supported by DTFJHeapObjectReader include
  - `Image`
  - `ImageAddressSpace`
  - `ImageProcess`
  - `JavaRuntime`
  - `ImageFactory` since 1.1
Returns:
  the extra data
Throws:
  `SnapshotException`
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 interface `IObjectReader`
Parameters:
  `snapshot` - the snapshot
Throws:
  `IOException` - an IO problem, or corrupt indexes or unexpected data in the dump
  `SnapshotException` - 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 interface `IObjectReader`
Parameters:
  `objectId` - the object id
  `snapshot` - 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 snapshot
  `IOException` - 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 interface `IObjectReader`
Parameters:
  `array` - The MAT array to be read
  `offset` - the offset into the array
  `length` - the number of items to be read
Returns:
  A primitive array holding the items
Throws:
  `IOException` - an IO problem or unexpected data in the dump
  `SnapshotException` - 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 interface `IObjectReader`
Parameters:
  `array` - The MAT array to be read
  `offset` - the offset into the array
  `length` - 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 dump
  `SnapshotException` - some other problem such as where the object is incompatible with the snapshot