Useful delphi TStream descendants

Delphi has a number of very useful stream classes.

They all derive from TStream.

The basic version is TFileStream – this writes to a filesystem.

There is also THandleStream – this writes to a windows handle – useful if you need to keep a file locked then write to it.

TStringStream is useful when dealing with delphi strings – especially when writing to another stream.

TBlobStream is used for accessing blob data from a database.

TResourceStream is used to read from embedded resources.

TMemoryStream that acts upon blocks of memory. 

There are also the adapter streams that takes another stream as a parameter.

 There is the TIStream that acts as a bridge between TStreams and the IStreams interface.

These include ZipStreams, EncryptionStreams, SocketStreams &c

These all take the approach that everything looks like a file this massively simplifys code.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s