tellp() returns std::streamoff, but we want to write something of
sizeof(unsigned int), so use an explicit cast to silence the compiler.