@Override
	public byte[] readBytes(long index, long length) throws IOException {
		ensureBounds(index, length);
		if (length > Integer.MAX_VALUE) {
			throw new IllegalArgumentException("Read length 0x%x exceeds Integer.MAX_VALUE (0x%x)"
					.formatted(length, Integer.MAX_VALUE));
		}
		int len = (int) length;
		byte[] result = new byte[len];
		int bytesRead = readBytes(index, result, 0, len);
		if (bytesRead != len) {
			throw new IOException("Unable to read " + len + " bytes at " + index);
		}
		return result;
	}
Returns the access mode the file was opened with.

@return {@link AccessMode} used to open file
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/FileByteProvider.java