@Override
	public int getBytes(byte[] b, int offset) {
		try {
			// if there is a buffer, and the number of bytes requested will fit in the buffer
			if (buffer.length > 0 && b.length <= buffer.length) {
				// bytes not in buffer
				if (offset < minOffset || (b.length + offset - 1) > maxOffset) {
					fillBuffer(offset);
				}
				// bytes are contained in the buffer
				if (offset >= minOffset && (b.length + offset - 1) <= maxOffset) {
					System.arraycopy(buffer, offset - minOffset, b, 0, b.length);
					return b.length;
				}
			}

			// grab from wrapped buffer, too many bytes, or no buffer
			return memBuffer.getBytes(b, computeOffset(offset));

		}
		catch (MemoryAccessException e) {
			return 0;
		}
	}
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