Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2000-06

TStream objects

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt
to Robert Scott Horning: Is anybody working on a TStream object or anything in that hierarchy? With the talk of…
Robert Scott Horning wrote
Is anybody working on a TStream object or anything in that hierarchy? With the talk of DFM files I thought it would be prudent to bring it up, especially because Borland uses the TStream to save and load components, as an encapsulating tool.

TStream and many descendents exist already in the FCL (unit classes) currently available:

TMemorystream / plain memory
TStringStream / in a string.
TFileStream / File
TPipeStream / Pipe under linux,Windows T(DE)CompressionStream / Compression with LZW compression (with zlib support) TBase64Stream / Base 64 en/de coding TIDEAStream / IDEA Encryption stream TSocketStream / TCP/IP or Unix socket streams

All come with example programs. (see fcl/test)

I think this is all you need ? I think you can set up quite a string of streams with this:
i.e start with a socket stream, attach a compression stream, attach a encryption stream, so anything written to the stream will be encrypted, compressed and sent over your socket to, say, a web server... All in 1 write statement.

Feel free to send me some if you need some more, I'll add them to the FCL. (They don't belong in Lazarus/LCL, since they're not IDE or GUI dependent)

Michael.

Reply by email

Robert Scott Horning

Is anybody working on a TStream object or anything in that hierarchy? With the talk of DFM files I thought it would be prudent to bring it up, especially because Borland uses the TStream to save and load components, as an encapsulating tool.

These are really handy little objects where you write to a generic "file" and then later implement how the data gets transferred, by disc file (hard or floppy), memory image, TCP/IP, another stream (sub-streams), Morse code telegraph, ham radio, Braille, or what ever else you can think of. If you design this properly, you can even decide during runtime what transmission path you want to use, and simply send the data to the "Stream" and let the stream decide where it will go.

Having some experience in writing some descendants of TStream in Delphi, I'm curious what work has been done in this manner.

Robert Scott Horning Trans-Lux West 1651 North 1000 West Logan, Utah 84321 Phone: (435) 716-8696 FAX: (435) 752-8513 E-mail:

Reply by email