Class AbstractStreamEmuUnixFileHandle<T>
java.lang.Object
ghidra.pcode.emu.unix.AbstractStreamEmuUnixFileHandle<T>
- Type Parameters:
T- the type of values in the file
- All Implemented Interfaces:
EmuUnixFileDescriptor<T>
- Direct Known Subclasses:
IOStreamEmuUnixFileHandle
public abstract class AbstractStreamEmuUnixFileHandle<T>
extends Object
implements EmuUnixFileDescriptor<T>
An abstract file descriptor having no "offset," typically for stream-like files
-
Field Summary
FieldsFields inherited from interface EmuUnixFileDescriptor
FD_STDERR, FD_STDIN, FD_STDOUT -
Constructor Summary
ConstructorsChangeConstructorDescriptionAbstractStreamEmuUnixFileHandle(PcodeMachine<T> machine, CompilerSpec cSpec) Construct a new handle -
Method Summary
ChangeModifier and TypeMethodDescriptionReturns the current offset of the file, or 0 if not applicable.longReturns the current offset of the file, or 0 if not applicable.readAbstract(T buf) Read from the file opened by this handlevoidseek(long offset) Seek to the given offsetvoidSeek to the given offsetstat()Returns thestatstructure of the file opened by this handle.writeAbstract(T buf) Write into the file opened by this handleMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EmuUnixFileDescriptor
close, read, write
-
Field Details
-
arithmetic
-
offsetBytes
protected final int offsetBytes
-
-
Constructor Details
-
AbstractStreamEmuUnixFileHandle
Construct a new handle- Parameters:
machine- the machine emulating the hardwarecSpec- the ABI of the target platform- See Also:
-
-
Method Details
-
getAbstractOffset NEW
Description copied from interface:EmuUnixFileDescriptorReturns the current offset of the file, or 0 if not applicable.- Specified by:
getAbstractOffsetin interfaceEmuUnixFileDescriptor<T>- Returns:
- the current offset of the file, or 0 if not applicable
-
getOffset MODIFIED
public long getOffset()return type: T → long-T getOffset()+long getOffset()Description copied from interface:EmuUnixFileDescriptorReturns the current offset of the file, or 0 if not applicable.- Specified by:
getOffsetin interfaceEmuUnixFileDescriptor<T>- Returns:
- the current offset of the file, or 0 if not applicable
-
seek
Description copied from interface:EmuUnixFileDescriptorSeek to the given offset- Specified by:
seekin interfaceEmuUnixFileDescriptor<T>- Parameters:
offset- the desired offset- Throws:
EmuIOException- if an error occurred
-
seek NEW
Description copied from interface:EmuUnixFileDescriptorSeek to the given offset- Specified by:
seekin interfaceEmuUnixFileDescriptor<T>- Parameters:
offset- the desired offset- Throws:
EmuIOException- if an error occurred
-
readAbstract NEW
Description copied from interface:EmuUnixFileDescriptorRead from the file opened by this handle- Specified by:
readAbstractin interfaceEmuUnixFileDescriptor<T>- Parameters:
buf- the destination buffer- Returns:
- the number of bytes read
- Throws:
EmuIOException- if an error occurred
-
writeAbstract NEW
Description copied from interface:EmuUnixFileDescriptorWrite into the file opened by this handle- Specified by:
writeAbstractin interfaceEmuUnixFileDescriptor<T>- Parameters:
buf- the source buffer- Returns:
- the number of bytes written
- Throws:
EmuIOException- if an error occurred
-
stat
Description copied from interface:EmuUnixFileDescriptorReturns thestatstructure of the file opened by this handle.- Specified by:
statin interfaceEmuUnixFileDescriptor<T>- Returns:
- the
statstructure of the file opened by this handle
-