int getBufferOffset(long filePos) throws EOFException {
			int ofs = (int) (filePos - pos);
			if (ofs >= len) {
				throw new EOFException();
			}
			return ofs;
		}
Writes the specified bytes to the file.
<p>
Protected by synchronized lock (See {@link #writeBytes(long, byte[], int, int)})

@param index file position of where to write
@param buffer byte array containing bytes to write
@param offset offset inside of byte array to start
@param length number of bytes from buffer to write
@throws IOException if error
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/FileByteProvider.java