Skip over navigation

Welcome to the all new DelphiDabbler website.

I hope you like it.

There are going to be bugs. Please report any you find on the website's issues page (GitHub account required). Thanks.

Click the close button and you won't see this message again.

Stream Extension Classes

Several classes to wrap and operate on TStream classes

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


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

Download v3.1.2

Stream Extension Classes is a sub-project of the DDabLib project which is maintained in a Subversion repository. The code is developed in the trunk/projects/streams branch.

Subversion users can check out the source code of the current release from the repository on SourceForge by doing:

svn checkout codedir

where codedir is the directory where you want to checkout code. To check out other versions, simply specify a different version number.

The latest development tree can be checked out using:

 svn checkout codedir

Check outs are read only, but you can easily contribute code: see Feedback & Queries below.


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.


The Stream Extension Classes are comprehensively documented online here

The project's change log can be viewed on SourceForge

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 Issue Tracker.

Click the Create Ticket button to create a ticket then complete the form giving as much information as possible.

The issue tracker is shared among all the projects in the DelphiDabbler Code Library, so please make sure you enter streams in the Project edit box to make it clear which project you are referring to. You should also choose Defect in the Type drop down list to report a bug or Enhancement to request a new feature.

If you have created a bug fix or have implemented a new feature please attach a zip file to your ticket that contains your source code.

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.


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.