private void readHeader() throws IOException {

		seekBlock(0, 0);

		// Check magic number
		long magicNumber = raf.readLong();
		if (magicNumber != MAGIC_NUMBER) {
			throw new IOException("Unrecognized file format");
		}

		// Read file ID
		fileId = raf.readLong();

		// Check file format version
		int headerFormatVersion = raf.readInt();
		if (headerFormatVersion != HEADER_FORMAT_VERSION) {
			throw new IOException("Unrecognized file format");
		}

		// Read buffer size, free buffer count, and first free buffer index
		blockSize = raf.readInt();
		bufferSize = blockSize - BUFFER_PREFIX_SIZE;
		int firstFreeBufferIndex = raf.readInt();
		long len = raf.length();
		if ((len % blockSize) != 0) {
			throw new IOException("Corrupt file");
		}
		bufferCount = (int) (len / blockSize) - 1;

		// Read user-defined integer parameters values
		int cnt = raf.readInt();
		clearParameters();
		for (int i = 0; i < cnt; i++) {
			int nameLen = raf.readInt();
			byte[] nameBytes = new byte[nameLen];
			raf.read(nameBytes);
			setParameter(new String(nameBytes, STRING_ENCODING), raf.readInt());
		}
		buildFreeIndexList(firstFreeBufferIndex);
	}
Read file header and initialize the user parameter and free buffer index lists.
@throws IOException if an I/O error occurs
Ghidra/Framework/DB/src/main/java/db/buffers/LocalBufferFile.java