RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
IStreamPersist Interface

IStreamPersist is the interface for responding to requests to load/save an object from/to a persistent stream.

Pascal
IStreamPersist = interface;
C++
__interface IStreamPersist;

Classes

IStreamPersist introduces two methods, SaveToStream, and LoadFromStreamthat allows the designer to respond a request to store or retrieve the implementing object to a persistent stream.  

You use SaveToStream to serialise an object, and save this data in a stream independent of the running application. This serialised version of the object literally persists and is available for loading back using LoadFromStream. It is then de-serialised, and reconstituted as an object.  

For example, the TGraphic class itself implements the IStreamPersist. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!