GetStream(Tag: String): Object;
Tag. Stream name.
The GetStream method gets user data stream from the copied time series database.
Executing the example requires an MDM repository with the MDM_REPO identifier, the file C:\Param.zip that contains a copy of the time series database, and the UserStream user-defined stream.
Sub Main;
Var
RubUpdateEx: ICubeMetaUpdateEx;
mb: IMetabase;
rds: IRdsDatabase;
CrInfo: IMetabaseObjectCreateInfo;
s: string;
progress: IMetabaseUpdateProgress;
iis: IIOStream;
Begin
RubUpdateEx := New CubeMetaUpdateClass.Create As ICubeMetaUpdateEx;
mb := MetabaseClass.Active;
RubUpdateEx.Metabase := mb;
rds := mb.ItemById("RDS_REPO").Bind As IRdsDatabase;
RubUpdateEx.RdsDatabase := rds;
RubUpdateEx.Load("C:\Param.zip");
iis := RubUpdateEx.GetStream("UserStream") As IIOStream;
Debug.WriteLine(iis.ReadByte);
CrInfo := RubUpdateEx.CreateInfo;
CrInfo.Parent := mb.Root;
s := Mb.GenerateId("FC_COPY");
CrInfo.Id := s;
CrInfo.Name := s;
RubUpdateEx.Apply(progress);
End Sub Main;
After executing the example a copy of the time series database with the FC_COPY identifier is created in the repository root from the C:\Param.zip file. The first byte of the UserStream user stream saved to the file is displayed in the console window.
See also: