Class RandomAccessMutableByteProvider

java.lang.Object
ghidra.app.util.bin.RandomAccessByteProvider
ghidra.app.util.bin.RandomAccessMutableByteProvider
All Implemented Interfaces:
ByteProvider, MutableByteProvider, Closeable, AutoCloseable

public class RandomAccessMutableByteProvider extends RandomAccessByteProvider implements MutableByteProvider
An implementation of ByteProvider where the underlying bytes are supplied by a random access file.
  • Constructor Details

    • RandomAccessMutableByteProvider

      public RandomAccessMutableByteProvider(File file) throws IOException
      Constructs a byte provider using the specified file
      Parameters:
      file - the file to open for random access
      Throws:
      FileNotFoundException - if the file does not exist
      IOException
    • RandomAccessMutableByteProvider

      public RandomAccessMutableByteProvider(File file, String permissions) throws IOException
      Constructs a byte provider using the specified file and permissions string
      Parameters:
      file - the file to open for random access
      permissions - indicating permissions used for open
      Throws:
      FileNotFoundException - if the file does not exist
      IOException
  • Method Details

    • writeByte

      public void writeByte(long index, byte value) throws IOException
      Description copied from interface: MutableByteProvider
      Writes a byte at the specified index.
      Specified by:
      writeByte in interface MutableByteProvider
      Parameters:
      index - the index to write the byte
      value - the value to write at the specified index
      Throws:
      IOException - if an I/O error occurs
    • writeBytes

      public void writeBytes(long index, byte[] values) throws IOException
      Description copied from interface: MutableByteProvider
      Writes a byte array at the specified index.
      Specified by:
      writeBytes in interface MutableByteProvider
      Parameters:
      index - the index to write the byte array
      values - the values to write at the specified index
      Throws:
      IOException - if an I/O error occurs