void truncate(int indexCount) throws IOException {

		if (readOnly) {
			throw new IOException("File is read-only");
		}

		long size = (indexCount + 1) * blockSize;
		raf.setLength(size);
		this.bufferCount = indexCount;
	}
Truncate the buffer file length to the specified index count.
@param indexCount the index count
@throws IOException if an I/O error occurs
Ghidra/Framework/DB/src/main/java/db/buffers/LocalBufferFile.java