@Override
	public byte[] readBytes(long index, long length) throws IOException {
		if (length < 0 || length > Integer.MAX_VALUE) {
			throw new IllegalArgumentException("unsupported length");
		}
		if (index < 0) {
			throw new IllegalArgumentException("invalid index");
		}
		long len = length();
		long lastIndex = index + length - 1;
		if (index >= len || lastIndex >= length()) {
			throw new EOFException();
		}
		byte[] bytes = new byte[(int) length];
		try {
			fileBytes.getOriginalBytes(index, bytes);
		}
		catch (IndexOutOfBoundsException e) {
			throw new IOException(e);
		}
		return bytes;
	}
Construct byte provider from original file bytes
@param fileBytes original file bytes
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/FileBytesProvider.java