private void fillBuffer(int offset) throws MemoryAccessException {
		// fill the buffer
		int nRead = memBuffer.getBytes(buffer, computeOffset(offset));

		if (nRead == 0) {
			throw new MemoryAccessException("No bytes available in memory to cache");
		}

		minOffset = offset;
		maxOffset = offset + nRead - 1;
	}
Compute offset into original memBuffer, making sure the offset doesn't wrap 
@param offset the offset relative to the baseOffset.
@return the offset relative to the original memBuffer.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/mem/WrappedMemBuffer.java