private void setUpdatedMemory(
      final long offset, final long sourceOffset, final long length, final Bytes value) {
    final long endIndex = sourceOffset + length;
    if (sourceOffset >= 0 && endIndex > 0) {
      final int srcSize = value.size();
      if (endIndex > srcSize) {
        final MutableBytes paddedAnswer = MutableBytes.create((int) length);
        if (sourceOffset < srcSize) {
          value.slice((int) sourceOffset, (int) (srcSize - sourceOffset)).copyTo(paddedAnswer, 0);
        }
        setUpdatedMemory(offset, paddedAnswer.copy());
      } else {
        setUpdatedMemory(offset, value.slice((int) sourceOffset, (int) length).copy());
      }
    }
  }
Copies bytes within memory.

<p>Copying behaves as if the values are copied to an intermediate buffer before writing.

@param dst The destination address
@param src The source address
@param length the number of bytes to copy
@param explicitMemoryUpdate true if triggered by a memory opcode, false otherwise
evm/src/main/java/org/hyperledger/besu/evm/frame/MessageFrame.java