Why do you need to read the file twice? You can either seek the stream to the start again, or just use e.g. `g_input_stream_read_all()` with `G_MAXUINT64`?