Package ghidra.program.model.pcode

# Class PackedBytes

java.lang.Object
ghidra.program.model.pcode.PackedBytes

public class PackedBytes extends Object

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PackedBytes(int startlen)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `find(int start, int val)`
  `int`
  `getByte(int streampos)`
  Inspect the middle of the byte stream accumulated so far
  `void`
  `insertByte(int streampos, int val)`
  Overwrite bytes that have already been written into the stream
  `int`
  `size()`
  `void`
  `write(byte[] byteArray)`
  Dump an array of bytes to the packed byte stream
  `void`
  `write(int val)`
  Dump a single byte to the packed byte stream
  `void`
  `writeTo(OutputStream s)`
  Write the accumulated packed byte stream onto the output stream

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PackedBytes

    public PackedBytes(int startlen)

- ## Method Details

  - ### 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 overwrite
      `val` - 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

  - ### write

    public void write(byte[] byteArray)
    Dump an array of bytes to the packed byte stream
    Parameters:
      `byteArray` - is the byte array

  - ### find

    public int find(int start, int val)

  - ### writeTo

    public void writeTo(OutputStream s) throws IOException
    Write the accumulated packed byte stream onto the output stream
    Parameters:
      `s` - is the output stream receiving the bytes
    Throws:
      `IOException` - for stream errors