Class AbsEmuUnixFileHandle<T>

java.lang.Object
ghidra.pcode.emu.unix.AbstractEmuUnixFileHandle<T>
ghidra.pcode.emu.unix.AbsEmuUnixFileHandle<T>
Type Parameters:
T - the type
All Implemented Interfaces:
EmuUnixFileDescriptor<T>

public class AbsEmuUnixFileHandle<T> extends AbstractEmuUnixFileHandle<T>
A file descriptor for non-concrete types
  • Constructor Details

  • Method Details

    • advanceOffset

      protected void advanceOffset(T len)
      Advance the handle's offset (negative to rewind)
      Parameters:
      len - the number of bytes to advance
    • isPositive

      protected boolean isPositive(T len)
    • getAbstractOffset

      public T getAbstractOffset()
      Description copied from interface: EmuUnixFileDescriptor
      Returns the current offset of the file, or 0 if not applicable.
      Returns:
      the current offset of the file, or 0 if not applicable
    • getOffset

      public long getOffset()
      Description copied from interface: EmuUnixFileDescriptor
      Returns the current offset of the file, or 0 if not applicable.
      Returns:
      the current offset of the file, or 0 if not applicable
    • seek

      public void seek(T offset) throws EmuIOException
      Description copied from interface: EmuUnixFileDescriptor
      Seek to the given offset
      Parameters:
      offset - the desired offset
      Throws:
      EmuIOException - if an error occurred
    • seek

      public void seek(long offset) throws EmuIOException
      Description copied from interface: EmuUnixFileDescriptor
      Seek to the given offset
      Parameters:
      offset - the desired offset
      Throws:
      EmuIOException - if an error occurred
    • readAbstract

      public T readAbstract(T buf) throws EmuIOException
      Description copied from interface: EmuUnixFileDescriptor
      Read from the file opened by this handle
      Parameters:
      buf - the destination buffer
      Returns:
      the number of bytes read
      Throws:
      EmuIOException - if an error occurred
    • read

      public int read(T buf) throws EmuIOException
      Description copied from interface: EmuUnixFileDescriptor
      Read from the file opened by this handle
      Parameters:
      buf - the destination buffer
      Returns:
      the number of bytes read
      Throws:
      EmuIOException - if an error occurred
    • writeAbstract

      public T writeAbstract(T buf) throws EmuIOException
      Description copied from interface: EmuUnixFileDescriptor
      Write into the file opened by this handle
      Parameters:
      buf - the source buffer
      Returns:
      the number of bytes written
      Throws:
      EmuIOException - if an error occurred
    • write

      public int write(T buf) throws EmuIOException
      Description copied from interface: EmuUnixFileDescriptor
      Write into the file opened by this handle
      Parameters:
      buf - the source buffer
      Returns:
      the number of bytes written
      Throws:
      EmuIOException - if an error occurred