private void copyByteRange(Memory toMem, Memory fromMem, AddressRange fromAddressRange)
			throws MemoryAccessException {

		// Copy the bytes for this range
		int length = 0;
		Address fromWriteAddress = fromAddressRange.getMinAddress();
		for (long len = fromAddressRange.getLength(); len > 0; len -= length) {
			length = (int) Math.min(len, Integer.MAX_VALUE);
			byte[] bytes = new byte[length];
			fromMem.getBytes(fromWriteAddress, bytes);
			Address toWriteAddress = originToResultTranslator.getAddress(fromWriteAddress);
			toMem.setBytes(toWriteAddress, bytes);
			if (len > length) {
				fromWriteAddress = fromWriteAddress.add(length);
			}
		}
	}
Copies the bytes to one program memory from another for the specified
address range.
@param toMem program memory that the bytes are copied to.
@param fromMem program memory the bytes are copied from.
@param fromAddressRange the address range to be copied.
The addresses in this range are derived from the program associated with the "to memory".

@throws MemoryAccessException if bytes can't be copied.
Ghidra/Features/Base/src/main/java/ghidra/program/util/ProgramMerge.java