Skip over navigation

Stream Extension Classes

Several classes to wrap and operate on TStream classes

Version 3.1.2
Released 2014-01-12
Platforms Win32 & Win64
Framework RTL
Compatibilty Delphi 4 & later

Overview

This library provides some classes that can be used to extend the functionality of Delphi's TStream classes.

The classes provided are:

  • A TStream derived class which can wrap another TStream. This is useful as a base class for filters to wrap round existing stream classes.
  • A set of classes that wrap existing streams and provide an IStream interface to them – like Delphi's previously undocumented TStreamAdapter class. Also included is a class that provides a IStream interface to any file or any handle stream.

Unit tests are provided for the classes in the Tests directory. You need to have DUnit installed in order to run these tests.

Three demo projects are provided in the download:

  1. IStreamWrap.dpr in the IStreamWrapDemo sub-directory. This is a VCL project that demonstrates the IStream wrapper classes in the PJIStreams unit.
  2. IStreamWrapFMX.dpr in the IStreamWrapDemoFMX sub-directory. This is a FireMonkey 2 project that demonstrates the IStream wrapper classes in the PJIStreams unit. It is similar, but not identical, to IStreamWrap.dpr.
  3. StreamWrap.dpr in the StreamWrapDemo sub-directory. This is a VCL project that demonstrates the PJStreamWrapper unit.

Get The Code

You can download the latest version of the Stream Extension Classes directly from SourceForge as dd-streams-3.1.2.zip.

Download v3.1.2

The Stream Extension Classes source code is hosted in the ddablib/streams GitHub repository. You can git clone or fork the repository as required.

Installation

The Stream Extension Classes, documents, demos and unit tests are supplied in a zip file. Before installing you need to extract all the files from the zip file, preserving the directory structure. The following files will be extracted:

  • PJStreamWrapper.pas – source code of the TPJStreamWrapper class.
  • PJIStreams.pas – source code of classes that implement the IStream interface.
  • ReadMe.htm – read-me file.
  • ChangeLog.txt – project change log.
  • MPL-2.txt – the Mozilla Public License v2.0.
  • Documentation.URL – short-cut to the unit's online documentation.

There are also demo projects in the Demos directory and unit tests in the Tests directory.

There are three possible ways to use the units.

  1. The simplest way is to add the units PJStreamWrapper.pas and PJIStreams.pas to your projects as you need them.
  2. To make the units easier to re-use you can either copy them to a folder on your Delphi search path, or add the folder where you extracted the units to the search path. You then simply use the units as required without needing to add them to your project.
  3. For maximum portability you can add the units to a Delphi design time package. If you need help doing this see here.

Documentation

The Stream Extension Classes are comprehensively documented online here

The project's change log can be viewed here.

A read-me file (ReadMe.htm) is included in the project download.

Feedback & Queries

If you find any bugs or want to suggest a new feature please report them using the Stream Extension Classes issue tracker.

If you have created a bug fix or have implemented a new feature please open a pull request for it.

Should you have any queries about using the classes please read the documentation. If you can't find an answer in the documentation then post a message in the discussion group.

License

The Stream Extension Classes are open source. They are copyright © 2000-2014 by Peter Johnson. The source code is made available under the terms of the Mozilla Public License v2.0. All relevant trademarks are acknowledged.