Skip to content

Latest commit

 

History

History
50 lines (30 loc) · 1.87 KB

TPJStreamWrapper.md

File metadata and controls

50 lines (30 loc) · 1.87 KB

TPJStreamWrapper class

Project: Stream Extension Classes

Unit: PJStreamWrapper

Applies to: ~>3.0

Description

This class is not normally used on its own. It is designed as a parent for classes that "wrap" a stream.

TPJStreamWrapper simply replicates the facilities in the wrapped stream. Each method simply calls the equivalent method of the wrapped stream.

Sub-classes will add methods to the base class and/or override the base class's handling of the Read, Write and Seek methods inherited from TStream.

Wrapping a TStream descendant object rather than adding functionality by extending the class means that the functionality provided by the wrapper class can be applied to any TStream descendant.

Study the StreamWrapDemo demo source code details of how this can be achieved.

Methods

TPJStreamWrapper inherits all the methods of TStream. Only new methods and those of TStream that are overridden are described here.

Public Methods

Method Description
Create Object constructor. Creates a new wrapper object for a given stream.
Read Override. Reads data from the wrapped stream into a buffer.
Seek Override. Updates the current position in the underlying stream.
Write Override. Writes data from a buffer to the wrapped stream.

Protected Methods

Method Description
SetSize Override. Sets the size of the wrapped stream.

Properties

The sole property is protected.

Property Description
BaseStream References the wrapped stream.

Events

The class defines no events.