Package ghidra.app.util.bin.format.omf.omf

# Class OmfData

java.lang.Object
ghidra.app.util.bin.format.omf.OmfRecord
ghidra.app.util.bin.format.omf.omf.OmfData

All Implemented Interfaces:
  `StructConverter`, `Comparable<OmfData>`

Direct Known Subclasses:
  `OmfEnumeratedData`, `OmfIteratedData`

public abstract class OmfData extends OmfRecord implements Comparable<OmfData>
Object representing data loaded directly into the final image.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Omf2or4`
  `dataOffset`
  `protected OmfIndex`
  `segmentIndex`

  ### Fields inherited from class ghidra.app.util.bin.format.omf.OmfRecord

  `checkSum, data, dataEnd, dataReader, recordLength, recordOffset, recordType`

  ### Fields inherited from interface ghidra.app.util.bin.StructConverter

  `ASCII, BYTE, DWORD, IBO32, IBO64, POINTER, QWORD, SLEB128, STRING, ULEB128, UTF16, UTF8, VOID, WORD`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OmfData(BinaryReader reader)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compareTo(OmfData o)`
  Compare datablocks by data offset
  `abstract byte[]`
  `getByteArray(BinaryReader reader)`
  Create a byte array holding the data represented by this object.
  `long`
  `getDataOffset()`
  `abstract int`
  `getLength()`
  `int`
  `getSegmentIndex()`
  `abstract boolean`
  `isAllZeroes()`

  ### Methods inherited from class ghidra.app.util.bin.format.omf.OmfRecord

  `calcCheckSum, getData, getRecordChecksum, getRecordLength, getRecordOffset, getRecordType, hasBigFields, parseData, toDataType, toString, validCheckSum`

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

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### segmentIndex

    protected OmfIndex segmentIndex

  - ### dataOffset

    protected Omf2or4 dataOffset

- ## Constructor Details

  - ### OmfData

    public OmfData(BinaryReader reader) throws IOException
    Throws:
      `IOException`

- ## Method Details

  - ### getSegmentIndex

    public int getSegmentIndex()
    Returns:
      get the segments index for this datablock

  - ### getDataOffset

    public long getDataOffset()
    Returns:
      the starting offset, within the loaded image, of this data

  - ### compareTo

    public int compareTo(OmfData o)
    Compare datablocks by data offset
    Specified by:
      `compareTo` in interface `Comparable<OmfData>`
    Returns:
      a value less than 0 for lower address, 0 for same address, or greater than 0 for higher address

  - ### getLength

    public abstract int getLength()
    Returns:
      the length of this data in bytes

  - ### getByteArray

    public abstract byte[] getByteArray(BinaryReader reader) throws IOException
    Create a byte array holding the data represented by this object. The length of the byte array should exactly match the value returned by getLength()
    Parameters:
      `reader` - is for pulling bytes directly from the binary image
    Returns:
      allocated and filled byte array
    Throws:
      `IOException` - for problems accessing data through the reader

  - ### isAllZeroes

    public abstract boolean isAllZeroes()
    Returns:
      true if this is a block entirely of zeroes