Package ghidra.util

# Interface GhidraDataConverter

All Superinterfaces:
  `DataConverter`, `Serializable`

All Known Implementing Classes:
  `GhidraBigEndianDataConverter`, `GhidraLittleEndianDataConverter`

public interface GhidraDataConverter extends DataConverter

- ## Method Summary

  Modifier and Type
  Method
  Description
  `BigInteger`
  `getBigInteger(MemBuffer buf, int offset, int size, boolean signed)`
  Generate a BigInteger value by invoking buf.getBytes at the specified offset.
  `static GhidraDataConverter`
  `getInstance(boolean isBigEndian)`
  Returns the correct GhidraDataConverter static instance for the requested endian-ness.
  `int`
  `getInt(MemBuffer buf, int offset)`
  Generate a int value by invoking buf.getBytes at the specified offset.
  `long`
  `getLong(MemBuffer buf, int offset)`
  Generate a long value by invoking buf.getBytes at the specified offset.
  `short`
  `getShort(MemBuffer buf, int offset)`
  Generate a short value by invoking buf.getBytes at the specified offset.

  ### Methods inherited from interface ghidra.util.DataConverter

  `getBigInteger, getBigInteger, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getInt, getInt, getLong, getLong, getShort, getShort, getSignedValue, getSignedValue, getValue, getValue, isBigEndian, putBigInteger, putBigInteger, putInt, putInt, putLong, putLong, putShort, putShort, putValue`

- ## Method Details

  - ### getInstance

    static GhidraDataConverter getInstance(boolean isBigEndian)
    Returns the correct GhidraDataConverter static instance for the requested endian-ness.
    Parameters:
      `isBigEndian` - boolean flag, true means big endian
    Returns:
      static GhidraDataConverter instance

  - ### getShort

    short getShort(MemBuffer buf, int offset) throws MemoryAccessException
    Generate a short value by invoking buf.getBytes at the specified offset.
    Parameters:
      `buf` - MemBuffer source of bytes
      `offset` - offset in mem buffer to read
    Returns:
      short value
    Throws:
      `MemoryAccessException` - if failed to read 2-bytes at the specified offset

  - ### getInt

    int getInt(MemBuffer buf, int offset) throws MemoryAccessException
    Generate a int value by invoking buf.getBytes at the specified offset.
    Parameters:
      `buf` - MemBuffer source of bytes
      `offset` - offset in mem buffer to read
    Returns:
      int value
    Throws:
      `MemoryAccessException` - if failed to read 4-bytes at the specified offset

  - ### getLong

    long getLong(MemBuffer buf, int offset) throws MemoryAccessException
    Generate a long value by invoking buf.getBytes at the specified offset.
    Parameters:
      `buf` - MemBuffer source of bytes
      `offset` - offset in mem buffer to read
    Returns:
      long value
    Throws:
      `MemoryAccessException` - if failed to read 8-bytes at the specified offset

  - ### getBigInteger

    BigInteger getBigInteger(MemBuffer buf, int offset, int size, boolean signed) throws MemoryAccessException
    Generate a BigInteger value by invoking buf.getBytes at the specified offset.
    Parameters:
      `buf` - MemBuffer source of bytes
      `offset` - offset in mem buffer to read
      `size` - number of bytes
      `signed` - boolean flag
    Returns:
      BigInteger value
    Throws:
      `MemoryAccessException` - if failed to read specified number of bytes at the specified offset