Package ghidra.program.model.pcode

# Class PackedEncodeOverlay

java.lang.Object
ghidra.program.model.pcode.PackedEncode
ghidra.program.model.pcode.PatchPackedEncode
ghidra.program.model.pcode.PackedEncodeOverlay

All Implemented Interfaces:
  `CachedEncoder`, `Encoder`, `PatchEncoder`

public class PackedEncodeOverlay extends PatchPackedEncode
Alter address space encoding for a specific overlay space. Any space that matches the overlay space is encoded as the overlayed space. This causes addresses in the overlay space to be converted into the underlying space.

- ## Field Summary

  ### Fields inherited from class ghidra.program.model.pcode.PackedEncode

  `outStream`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PackedEncodeOverlay(OverlayAddressSpace spc)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `setOverlay(OverlayAddressSpace spc)`
  `void`
  `writeSpace(AttributeId attribId, AddressSpace spc)`
  Write an address space reference into the encoding The address space is associated with the given AttributeId annotation and the current open element.
  `void`
  `writeSpaceId(AttributeId attribId, long spaceId)`
  Write a given raw spaceid (as returned by AddressSpace.getSpaceID()) as an attribute.

  ### Methods inherited from class ghidra.program.model.pcode.PatchPackedEncode

  `clear, isEmpty, patchIntegerAttribute, size, writeTo`

  ### Methods inherited from class ghidra.program.model.pcode.PackedEncode

  `closeElement, getOutputStream, openElement, writeBool, writeHeader, writeInteger, writeOpcode, writeSignedInteger, writeSpace, writeString, writeStringIndexed, writeUnsignedInteger`

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

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

  ### Methods inherited from interface ghidra.program.model.pcode.Encoder

  `closeElement, openElement, writeBool, writeOpcode, writeSignedInteger, writeSpace, writeString, writeStringIndexed, writeUnsignedInteger`

- ## Constructor Details

  - ### PackedEncodeOverlay

    public PackedEncodeOverlay(OverlayAddressSpace spc) throws AddressFormatException
    Throws:
      `AddressFormatException`

- ## Method Details

  - ### setOverlay

    public void setOverlay(OverlayAddressSpace spc) throws AddressFormatException
    Throws:
      `AddressFormatException`

  - ### writeSpace

    public void writeSpace(AttributeId attribId, AddressSpace spc) throws IOException
    Description copied from interface: `Encoder`
    Write an address space reference into the encoding The address space is associated with the given AttributeId annotation and the current open element.
    Specified by:
      `writeSpace` in interface `Encoder`
    Overrides:
      `writeSpace` in class `PackedEncode`
    Parameters:
      `attribId` - is the given AttributeId annotation
      `spc` - is the address space to encode
    Throws:
      `IOException` - for errors in the underlying stream

  - ### writeSpaceId

    public void writeSpaceId(AttributeId attribId, long spaceId) throws IOException
    Description copied from interface: `PatchEncoder`
    Write a given raw spaceid (as returned by AddressSpace.getSpaceID()) as an attribute. The effect is the same as if writeSpace() was called with the AddressSpace matching the spaceid, i.e. the decoder will read this as just space attribute.
    Specified by:
      `writeSpaceId` in interface `PatchEncoder`
    Overrides:
      `writeSpaceId` in class `PatchPackedEncode`
    Parameters:
      `attribId` - is the attribute
      `spaceId` - is the given spaceid
    Throws:
      `IOException` - for problems writing to the stream