Welcome to the new DelphiDabbler Code Library Documentation.

This is a new site that's currently running on alpha code. There are going to be bugs. If you discover any, please report them on the site's issues page (GitHub account required). Thanks.

Warning: Many URLs are going to change. Refer to the README file to discover which library project's documentation has been completed.

Create constructor

Project: Stream Extension Classes

Unit: PJIStreams

Class: TPJIStreamWrapper

Applies to: ~>3.0

constructor Create(const Stream: TStream; const CloseStream: Boolean = False);


Object constructor. Creates a new wrapper (or adapter) object for a given TStream that supports the IStream interface. Calls to methods of IStream are mapped onto calls on the wrapped stream.



Setting the CloseStream parameter to True, hence causing the wrapper object to free the wrapped stream on destruction, saves the user from having to remember to free the wrapped stream. It also allows for wrapped streams to be created “on the fly” in the constructor call to be freed without keeping a reference to them.