Package ghidra.program.model.mem

# Interface MemBufferMixin

All Superinterfaces:
  `MemBuffer`

All Known Implementing Classes:
  `AbstractBytesPcodeExecutorStatePiece.StateMemBuffer`

public interface MemBufferMixin extends MemBuffer

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default BigInteger`
  `getBigInteger(int offset, int size, boolean signed)`
  returns the value at the given offset, taking into account the endianess.
  `default byte`
  `getByte(int offset)`
  Get one byte from memory at the current position plus offset.
  `default int`
  `getBytes(byte[] b, int offset)`
  Reads `b.length` bytes from this memory buffer starting at the address of this memory buffer plus the given memoryBufferOffset from that position.
  `int`
  `getBytes(ByteBuffer buffer, int addressOffset)`
  `default ByteBuffer`
  `getBytesInFull(int offset, int len)`
  `default int`
  `getInt(int offset)`
  returns the int at the given offset, taking into account the endianess.
  `default long`
  `getLong(int offset)`
  returns the long at the given offset, taking into account the endianess.
  `default short`
  `getShort(int offset)`
  returns the short at the given offset, taking into account the endianess.

  ### Methods inherited from interface ghidra.program.model.mem.MemBuffer

  `getAddress, getInputStream, getInputStream, getMemory, getUnsignedByte, getUnsignedInt, getUnsignedShort, getVarLengthInt, getVarLengthUnsignedInt, isBigEndian, isInitializedMemory`

- ## Method Details

  - ### getBytes

    int getBytes(ByteBuffer buffer, int addressOffset)

  - ### getByte

    default byte getByte(int offset) throws MemoryAccessException
    Description copied from interface: `MemBuffer`
    Get one byte from memory at the current position plus offset.
    Specified by:
      `getByte` in interface `MemBuffer`
    Parameters:
      `offset` - the displacement from the current position.
    Returns:
      the data at offset from the current position.
    Throws:
      `MemoryAccessException` - if memory cannot be read at the specified offset

  - ### getBytes

    default int getBytes(byte[] b, int offset)
    Description copied from interface: `MemBuffer`
    Reads `b.length` bytes from this memory buffer starting at the address of this memory buffer plus the given memoryBufferOffset from that position. The actual number of bytes may be fewer if bytes can't be read.
    Specified by:
      `getBytes` in interface `MemBuffer`
    Parameters:
      `b` - the buffer into which bytes will be placed
      `offset` - the offset in this memory buffer from which to start reading bytes.
    Returns:
      the number of bytes read which may be fewer than b.length if available bytes are exhausted or no bytes are available at the specified offset.

  - ### getBytesInFull

    default ByteBuffer getBytesInFull(int offset, int len) throws MemoryAccessException
    Throws:
      `MemoryAccessException`

  - ### getShort

    default short getShort(int offset) throws MemoryAccessException
    Description copied from interface: `MemBuffer`
    returns the short at the given offset, taking into account the endianess.
    Specified by:
      `getShort` in interface `MemBuffer`
    Parameters:
      `offset` - the offset from the membuffers origin (the address that it is set at)
    Returns:
      the short at the given offset, taking into account the endianess.
    Throws:
      `MemoryAccessException` - if a 2-byte short value cannot be read at the specified offset

  - ### getInt

    default int getInt(int offset) throws MemoryAccessException
    Description copied from interface: `MemBuffer`
    returns the int at the given offset, taking into account the endianess.
    Specified by:
      `getInt` in interface `MemBuffer`
    Parameters:
      `offset` - the offset from the membuffers origin (the address that it is set at)
    Returns:
      the int at the given offset, taking into account the endianess.
    Throws:
      `MemoryAccessException` - if a 4-byte integer value cannot be read at the specified offset

  - ### getLong

    default long getLong(int offset) throws MemoryAccessException
    Description copied from interface: `MemBuffer`
    returns the long at the given offset, taking into account the endianess.
    Specified by:
      `getLong` in interface `MemBuffer`
    Parameters:
      `offset` - the offset from the membuffers origin (the address that it is set at)
    Returns:
      the long at the given offset, taking into account the endianess.
    Throws:
      `MemoryAccessException` - if a 8-byte long value cannot be read at the specified offset

  - ### getBigInteger

    default BigInteger getBigInteger(int offset, int size, boolean signed) throws MemoryAccessException
    Description copied from interface: `MemBuffer`
    returns the value at the given offset, taking into account the endianess.
    Specified by:
      `getBigInteger` in interface `MemBuffer`
    Parameters:
      `offset` - the offset from the membuffers origin (the address that it is set at)
      `size` - the number of bytes to include in the value
      `signed` - true if value should be treated as a signed twos-compliment value.
    Returns:
      the value at the given offset, taking into account the endianess.
    Throws:
      `MemoryAccessException` - if the request size value cannot be read at the specified offset