Package ghidra.app.util

# Class ByteCopier

java.lang.Object
ghidra.app.util.ByteCopier

public abstract class ByteCopier extends Object
Base class that can copy bytes into a Transferable object, and paste bytes into a program.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `ByteCopier.ByteStringTransferable`
  `protected class`
  `ByteCopier.PasteByteStringCommand`
  `static class`
  `ByteCopier.ProgrammingByteStringTransferable`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static DataFlavor`
  `BYTE_STRING_FLAVOR`
  `static final ClipboardType`
  `BYTE_STRING_NO_SPACE_TYPE`
  `static DataFlavor`
  `BYTE_STRING_NO_SPACES_FLAVOR`
  `static final ClipboardType`
  `BYTE_STRING_TYPE`
  `static DataFlavor`
  `CPP_BYTE_ARRAY_FLAVOR`
  `static final ClipboardType`
  `CPP_BYTE_ARRAY_TYPE`
  `protected ProgramLocation`
  `currentLocation`
  `protected Program`
  `currentProgram`
  `protected ProgramSelection`
  `currentSelection`
  `protected static final List<ClipboardType>`
  `EMPTY_LIST`
  `static DataFlavor`
  `PYTHON_BYTE_STRING_FLAVOR`
  `static final ClipboardType`
  `PYTHON_BYTE_STRING_TYPE`
  `static DataFlavor`
  `PYTHON_LIST_FLAVOR`
  `static final ClipboardType`
  `PYTHON_LIST_TYPE`
  `protected PluginTool`
  `tool`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `ByteCopier()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected Transferable`
  `copyBytes(ClipboardType copyType, TaskMonitor monitor)`
  `protected Transferable`
  `copyBytes(AddressSetView addresses, boolean includeSpaces, TaskMonitor monitor)`
  `protected String`
  `copyBytesAsString(AddressSetView addresses, boolean includeSpaces, TaskMonitor monitor)`
  `protected String`
  `copyBytesAsString(AddressSetView addresses, String delimiter, TaskMonitor monitor)`
  `static Transferable`
  `createStringTransferable(String text)`
  Create a Transferable from the given text.
  `protected AddressSetView`
  `getSelectedAddresses()`
  `protected boolean`
  `pasteBytes(Transferable pasteData)`
  `protected boolean`
  `pasteByteString(String string)`

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

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

- ## Field Details

  - ### BYTE_STRING_FLAVOR

    public static DataFlavor BYTE_STRING_FLAVOR

  - ### BYTE_STRING_NO_SPACES_FLAVOR

    public static DataFlavor BYTE_STRING_NO_SPACES_FLAVOR

  - ### PYTHON_BYTE_STRING_FLAVOR

    public static DataFlavor PYTHON_BYTE_STRING_FLAVOR

  - ### PYTHON_LIST_FLAVOR

    public static DataFlavor PYTHON_LIST_FLAVOR

  - ### CPP_BYTE_ARRAY_FLAVOR

    public static DataFlavor CPP_BYTE_ARRAY_FLAVOR

  - ### EMPTY_LIST

    protected static final List<ClipboardType> EMPTY_LIST

  - ### BYTE_STRING_TYPE

    public static final ClipboardType BYTE_STRING_TYPE

  - ### BYTE_STRING_NO_SPACE_TYPE

    public static final ClipboardType BYTE_STRING_NO_SPACE_TYPE

  - ### PYTHON_BYTE_STRING_TYPE

    public static final ClipboardType PYTHON_BYTE_STRING_TYPE

  - ### PYTHON_LIST_TYPE

    public static final ClipboardType PYTHON_LIST_TYPE

  - ### CPP_BYTE_ARRAY_TYPE

    public static final ClipboardType CPP_BYTE_ARRAY_TYPE

  - ### tool

    protected PluginTool tool

  - ### currentProgram

    protected Program currentProgram

  - ### currentSelection

    protected ProgramSelection currentSelection

  - ### currentLocation

    protected ProgramLocation currentLocation

- ## Constructor Details

  - ### ByteCopier

    protected ByteCopier()

- ## Method Details

  - ### getSelectedAddresses

    protected AddressSetView getSelectedAddresses()

  - ### copyBytes

    protected Transferable copyBytes(AddressSetView addresses, boolean includeSpaces, TaskMonitor monitor)

  - ### copyBytesAsString

    protected String copyBytesAsString(AddressSetView addresses, boolean includeSpaces, TaskMonitor monitor)

  - ### copyBytesAsString

    protected String copyBytesAsString(AddressSetView addresses, String delimiter, TaskMonitor monitor)

  - ### copyBytes

    protected Transferable copyBytes(ClipboardType copyType, TaskMonitor monitor)

  - ### pasteBytes

    protected boolean pasteBytes(Transferable pasteData) throws UnsupportedFlavorException, IOException
    Throws:
      `UnsupportedFlavorException`
      `IOException`

  - ### pasteByteString

    protected boolean pasteByteString(String string)

  - ### createStringTransferable

    public static Transferable createStringTransferable(String text)
    Create a Transferable from the given text.
    Parameters:
      `text` - text used to create a Transferable
    Returns:
      a Transferable