@Override
			public int read() throws IOException {

				if (bytesRemaining <= 0) {
					return -1;
				}

				if (bufferPos == buffer.length) {
					int size = Math.min(buffer.length, bytesRemaining);
					memState.getChunk(buffer, start.getAddressSpace(), nextBufferOffset, size,
						false);
					nextBufferOffset += buffer.length;
					bufferPos = 0;
				}

				byte b = buffer[bufferPos++];
				--bytesRemaining;
				return b;
			}
Create a new initialized memory block using the current emulator memory state

@param name block name
@param start start address of the block
@param length the size of the block
@param overlay if true, the block will be created as an OVERLAY which means that a new
           overlay address space will be created and the block will have a starting address
           at the same offset as the given start address parameter, but in the new address
           space.
@param monitor
@return new memory block
@throws LockException if exclusive lock not in place (see haveLock())
@throws MemoryConflictException if the new block overlaps with a previous block
@throws AddressOverflowException if the start is beyond the address space
@throws CancelledException user cancelled operation
@throws DuplicateNameException
Ghidra/Framework/Emulation/src/main/java/ghidra/app/emulator/EmulatorHelper.java