public void setChunk(long offset, int size, byte[] val) {
		int cursize;
		int count;
		long pagemask = (pagesize - 1);
		long offalign;
		int skip;
		int bufOffset = 0;

		count = 0;
		while (count < size) {
			cursize = pagesize;
			offset = space.truncateOffset(offset);
			offalign = offset & ~pagemask;
			skip = 0;
			if (offalign != offset) {
				skip = (int) (offset - offalign);
				cursize -= skip;
			}
			if (size - count < cursize)
				cursize = size - count;
			setPage(offalign, val, skip, cursize, bufOffset);
			count += cursize;
			offset += cursize;
			bufOffset += cursize;
		}
	}
This the most general method for writing a sequence of bytes into the memory bank.
The initial offset and page writes will be wrapped within the address space.

@param offset is the start of the byte range to be written.  This offset will be wrapped
within the space 
@param size is the number of bytes to write
@param val is a pointer to the sequence of bytes to be written into the bank
Ghidra/Framework/Emulation/src/main/java/ghidra/pcode/memstate/MemoryBank.java