RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TWriter Class

TWriter is a specialized filer object that writes data to its associated stream.

Pascal
TWriter = class(TFiler);
C++
class TWriter : public TFiler;

Classes

TWriter is used internally by the component streaming system to write information associated with a component, such as published properties of components or custom property data, to a stream. TWriter handles the mechanics of writing the data associated with a component to a stream. It is the writer object, rather than the stream, that is responsible for handling the complexities of streaming components. These include methods for: 

Writing different kinds of items to the associated stream. 

Writing property deltas used for streaming inherited forms and properties with default values. 

Writing nested groups of items or collections to the stream. 

Other methods and properties of TWriter are used for interacting with stream and component objects. 

Do not directly create writer objects. Writers are automatically created in stream object methods or in global routines that initiate the streaming process. These include: 

the global routine ObjectTextToBinary procedure, which directly creates a writer. 

the global WriteComponentResFile function, which creates a file stream that creates a writer. 

the WriteDescendent method of TStream, which creates a writer object. 

Once the streaming process is underway, programs do not need to directly manipulate writer objects. The interaction between the writer, component, and stream objects happens automatically in methods of these objects that make calls to each other. 

 

ObjectTextToBinary 

TComponent 

TReader 

TStream 

TStream 

WriteComponentResFile 

Using Streams to Read or Write Data

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