Skip to content

Latest commit

 

History

History
26 lines (15 loc) · 1.13 KB

TPJHandleIStreamWrapper-Create.md

File metadata and controls

26 lines (15 loc) · 1.13 KB

Create constructor

Project: Stream Extension Classes

Unit: PJIStreams

Class: TPJHandleIStreamWrapper

Applies to: ~>3.0

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

Description

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

Parameters:

  • Stream -- THandleStream stream that is "wrapped" by this object.
  • CloseStream -- Determines whether the wrapped stream object is freed when this wrapper object is destroyed. Pass True to this parameter to free the wrapped stream on destruction or False to leave it unchanged.

Remarks

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.