PLUGIN_API PlugProcessor::setState (IBStream* state)

Hi,
How does streamer.readFloat know where to go and get the value for mGain
without some kind of ID or address?

tresult PLUGIN_API PlugProcessor::setState (IBStream* state)
{
if (!state)
return kResultFalse;

// called when we load a preset or project, the model has to be reloaded
IBStreamer streamer (state, kLittleEndian);
float savedParam1 = 0.f;
if (streamer.readFloat (savedParam1) == false)// 
    return kResultFalse;
mGain = savedParam1;// How did streamer.readFloat know what mGain is suppose to be?

return kResultOk;

}

The stream is position based. When you write in the stream you are supposed to write in a given order:

stream.writeFloat(xxx);
stream.writeInt(xxx);

And when you read it back you have to use the same order, otherwise you will read garbage…

This is from steinberg media.Tutorials:
// called when we load a preset or project, the model has to be reloaded
IBStreamer streamer (state, kLittleEndian);
float savedParam1 = 0.f;
if (streamer.readFloat (savedParam1) == false)//
return kResultFalse;
mGain = savedParam1;
//////////////////////////////////////////////////////////////////////////////////////////
Question 1:
Where did streamer.readFloat get a value for mGain?
and how did it know where to go look for it?

Question 2:
How do I take a value from a variable in MY CODE and pass it to
a “widget” on the User Interface in order to display it in something like a “parameter view” widget.
That should be easy to do.