@Override
	public int putBytes(long snap, Address start, ByteBuffer buf) {
		assertInSpace(start);
		int pos = buf.position();
		try (LockHold hold = LockHold.lock(lock.writeLock())) {

			ByteBuffer oldBuf = ByteBuffer.allocate(buf.remaining());
			getBytes(snap, start, oldBuf);

			OutSnap lastSnap = new OutSnap(snap);
			Set<TraceAddressSnapRange> changed = new HashSet<>();
			int result = doPutBytes(snap, start, buf, lastSnap, changed);
			if (result > 0) {
				Address end = start.add(result - 1);
				doSetState(snap, start, end, TraceMemoryState.KNOWN);

				// Read back the written bytes and fire event
				byte[] bytes = new byte[result];
				byte[] oldBytes = new byte[result];
				buf.get(pos, bytes);
				oldBuf.get(0, oldBytes);
				ImmutableTraceAddressSnapRange tasr = new ImmutableTraceAddressSnapRange(start,
					start.add(result - 1), snap, lastSnap.snap);
				trace.setChanged(new TraceChangeRecord<>(TraceEvents.BYTES_CHANGED, this, tasr,
					oldBytes, bytes));

				// Fixup affected code units
				DBTraceCodeSpace codeSpace = trace.getCodeManager().get(this, false);
				if (codeSpace != null) {
					codeSpace.bytesChanged(changed, snap, start, oldBytes, bytes);
				}
				// Clear program view caches
				trace.updateViewsBytesChanged(tasr.getRange());
			}
			return result;
		}
		catch (IOException e) {
			blockStore.dbError(e);
			return 0;
		}
	}
Locate the soonest block entry for the given offset-snap pair

<p>
To qualify, the entry must have a snap greater than (or optionally equal to) that given and
an offset exactly equal to that given. That is, it is the earliest in time, but most follow
the given snap. Additionally, if the given snap is in scratch space, the found entry must
also be in scratch space.

@param loc the offset-snap pair
@param inclusive true to allow equal snap
@return the found entry, or null
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/memory/DBTraceMemorySpace.java