System.Classes.IStreamPersist

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

IStreamPersist = interface

C++

__interface  INTERFACE_UUID("{B8CD12A3-267A-11D4-83DA-00C04F60B2DD}") IStreamPersist  : public System::IInterface

Properties

Type Visibility Source Unit Parent
interface
class
public
System.Classes.pas
System.Classes.hpp
System.Classes System.Classes

Description

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

IStreamPersist introduces two methods, SaveToStream and LoadFromStream, which 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.

See Also