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 leftR- 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
FieldsModifier and TypeFieldDescriptionprotected final EmuFileContents<L> protected final EmuFileContents<R> -
Constructor Summary
ConstructorsConstructorDescriptionPairedEmuFileContents(EmuFileContents<L> left, EmuFileContents<R> right) Create a paired file contents -
Method Summary
Modifier and TypeMethodDescriptionlongCopy values from the file into the given buffervoidtruncate()Erase the contentslongWrite values from the given buffer into the file
-
Field Details
-
left
-
right
-
-
Constructor Details
-
PairedEmuFileContents
Create a paired file contents- Parameters:
left- the left contentsright- the right contents
-
-
Method Details
-
read
Description copied from interface:EmuFileContentsCopy values from the file into the given buffer- Specified by:
readin interfaceEmuFileContents<L>- Parameters:
offset- the offset in the file to readbuf- the destination buffer, whose size must be knownfileSize- the size of the file- Returns:
- the number of bytes (not necessarily concrete) read
-
write
Description copied from interface:EmuFileContentsWrite values from the given buffer into the file- Specified by:
writein interfaceEmuFileContents<L>- Parameters:
offset- the offset in the file to writebuf- the source buffer, whose size must be knowncurSize- the current size of the file- Returns:
- the number of bytes (not necessarily concrete) written
-
truncate
public void truncate()Description copied from interface:EmuFileContentsErase the contentsNote 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:
truncatein interfaceEmuFileContents<L>
-