Package ghidra.program.model.lang
Class PackedBytes
- java.lang.Object
-
- ghidra.program.model.lang.PackedBytes
-
public class PackedBytes extends java.lang.ObjectA class for dynamically collecting a stream of bytes and then later dumping those bytes to a stream It allows the bytes to be edited in the middle of collection
-
-
Constructor Summary
Constructors Constructor Description PackedBytes(int startlen)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intfind(int start, int val)intgetByte(int streampos)Inspect the middle of the byte stream accumulated so farvoidinsertByte(int streampos, int val)Overwrite bytes that have already been written into the streamintsize()voidwrite(int val)Dump a single byte to the packed byte streamvoidwriteTo(java.io.OutputStream s)Write the accumulated packed byte stream onto the output stream
-
-
-
Method Detail
-
size
public int size()
-
getByte
public int getByte(int streampos)
Inspect the middle of the byte stream accumulated so far- Parameters:
streampos- is the index of the byte to inspect- Returns:
- a byte value from the stream
-
insertByte
public void insertByte(int streampos, int val)Overwrite bytes that have already been written into the stream- Parameters:
streampos- is the index of the byte to overwriteval- is the value to overwrite with
-
write
public void write(int val)
Dump a single byte to the packed byte stream- Parameters:
val- is the byte to be written
-
find
public int find(int start, int val)
-
writeTo
public void writeTo(java.io.OutputStream s) throws java.io.IOExceptionWrite the accumulated packed byte stream onto the output stream- Parameters:
s- is the output stream receiving the bytes- Throws:
java.io.IOException
-
-