Package ghidra.app.util.bin
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.
-
Field Summary
Fields inherited from class ghidra.app.util.bin.RandomAccessByteProvider
file, randomAccessFileFields inherited from interface ghidra.app.util.bin.ByteProvider
EMPTY_BYTEPROVIDER -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a byte provider using the specified fileRandomAccessMutableByteProvider(File file, String permissions) Constructs a byte provider using the specified file and permissions string -
Method Summary
Modifier and TypeMethodDescriptionvoidwriteByte(long index, byte value) Writes a byte at the specified index.voidwriteBytes(long index, byte[] values) Writes a byte array at the specified index.Methods inherited from class ghidra.app.util.bin.RandomAccessByteProvider
close, getAbsolutePath, getFile, getFSRL, getInputStream, getName, isValidIndex, length, readByte, readBytes, setFSRL, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.app.util.bin.ByteProvider
close, getAbsolutePath, getFile, getFSRL, getInputStream, getName, isEmpty, isValidIndex, length, readByte, readBytes
-
Constructor Details
-
RandomAccessMutableByteProvider
Constructs a byte provider using the specified file- Parameters:
file- the file to open for random access- Throws:
FileNotFoundException- if the file does not existIOException
-
RandomAccessMutableByteProvider
Constructs a byte provider using the specified file and permissions string- Parameters:
file- the file to open for random accesspermissions- indicating permissions used for open- Throws:
FileNotFoundException- if the file does not existIOException
-
-
Method Details
-
writeByte
Description copied from interface:MutableByteProviderWrites a byte at the specified index.- Specified by:
writeBytein interfaceMutableByteProvider- Parameters:
index- the index to write the bytevalue- the value to write at the specified index- Throws:
IOException- if an I/O error occurs
-
writeBytes
Description copied from interface:MutableByteProviderWrites a byte array at the specified index.- Specified by:
writeBytesin interfaceMutableByteProvider- Parameters:
index- the index to write the byte arrayvalues- the values to write at the specified index- Throws:
IOException- if an I/O error occurs
-