@Override
	public synchronized long read(long offset, byte[] buf, long fileSize) {
		// We're using an in-memory array, so limited to int offsets
		if (offset > Integer.MAX_VALUE) {
			throw new EmuIOException("Offset is past end of file");
		}
		long len = Math.min(buf.length, fileSize - offset);
		if (len < 0) {
			throw new EmuIOException("Offset is past end of file");
		}
		System.arraycopy(content, (int) offset, buf, 0, (int) len);
		return len;
	}
A concrete in-memory bytes store for simulated file contents

<p>
Note that currently, the total contents cannot exceed a Java array, so the file must remain less
than 2GB in size.
Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/sys/BytesEmuFileContents.java