Package ghidra.pcode.emu.sys

# Class PairedEmuFileContents<L,R>

java.lang.Object
ghidra.pcode.emu.sys.PairedEmuFileContents<L,R>

Type Parameters:
  `L` - the type of values for the left
  `R` - the type of values for the right

All Implemented Interfaces:
  `EmuFileContents<org.apache.commons.lang3.tuple.Pair<L,R>>`

public class PairedEmuFileContents<L,R> extends Object implements EmuFileContents<org.apache.commons.lang3.tuple.Pair<L,R>>
The analog of `PairedPcodeExecutorStatePiece` for simulated file contents

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final EmuFileContents<L>`
  `left`
  `protected final EmuFileContents<R>`
  `right`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PairedEmuFileContents(EmuFileContents<L> left, EmuFileContents<R> right)`
  Create a paired file contents

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `read(long offset, org.apache.commons.lang3.tuple.Pair<L,R> buf, long fileSize)`
  Copy values from the file into the given buffer
  `void`
  `truncate()`
  Erase the contents
  `long`
  `write(long offset, org.apache.commons.lang3.tuple.Pair<L,R> buf, long curSize)`
  Write values from the given buffer into the file

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

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

- ## Field Details

  - ### left

    protected final EmuFileContents<L> left

  - ### right

    protected final EmuFileContents<R> right

- ## Constructor Details

  - ### PairedEmuFileContents

    public PairedEmuFileContents(EmuFileContents<L> left, EmuFileContents<R> right)
    Create a paired file contents
    Parameters:
      `left` - the left contents
      `right` - the right contents

- ## Method Details

  - ### read

    public long read(long offset, org.apache.commons.lang3.tuple.Pair<L,R> buf, long fileSize)
    Description copied from interface: `EmuFileContents`
    Copy values from the file into the given buffer
    Specified by:
      `read` in interface `EmuFileContents<L>`
    Parameters:
      `offset` - the offset in the file to read
      `buf` - the destination buffer, whose size must be known
      `fileSize` - the size of the file
    Returns:
      the number of bytes (not necessarily concrete) read

  - ### write

    public long write(long offset, org.apache.commons.lang3.tuple.Pair<L,R> buf, long curSize)
    Description copied from interface: `EmuFileContents`
    Write values from the given buffer into the file
    Specified by:
      `write` in interface `EmuFileContents<L>`
    Parameters:
      `offset` - the offset in the file to write
      `buf` - the source buffer, whose size must be known
      `curSize` - the current size of the file
    Returns:
      the number of bytes (not necessarily concrete) written

  - ### truncate

    public void truncate()
    Description copied from interface: `EmuFileContents`
    Erase the contents

    Note that the file's size will be set to 0, so actual erasure of the contents may not be necessary, but if the contents are expensive to store, they ought to be disposed.

    Specified by:
      `truncate` in interface `EmuFileContents<L>`