@Override
		public boolean applyTo(Program program) {
			String validString = string;
			if (!isOnlyAsciiBytes(string)) {
				tool.setStatusInfo("Pasted string contained non-text ascii bytes. " +
					"Only the ascii will be used.", true);
				validString = keepOnlyAsciiBytes(string);
			}

			byte[] bytes = getBytes(validString);
			if (bytes == null) {
				status = "Improper data format. Expected sequence of hex bytes";
				tool.beep();
				return false;
			}

			// Ensure that we are not writing over instructions
			Address address = currentLocation.getAddress();
			if (!hasEnoughSpace(program, address, bytes.length)) {
				status =
					"Not enough space to paste all bytes.  Encountered data or instructions.";
				tool.beep();
				return false;
			}

			// Ask the user before pasting a string into the program.  Since having a string in
			// the clipboard is so common, this is to prevent an accidental paste.
			if (!confirmPaste(validString)) {
				return true; // the user cancelled; the command is successful
			}

			boolean pastedAllBytes = pasteBytes(program, bytes);
			if (!pastedAllBytes) {
				tool.setStatusInfo("Not all bytes were pasted due to memory access issues",
					true);
			}

			return true;
		}
Create a Transferable from the given text.

@param text text used to create a Transferable
@return a Transferable
Ghidra/Features/Base/src/main/java/ghidra/app/util/ByteCopier.java