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.
Project: Stream Extension Classes
Unit: PJStreamWrapper
Applies to: ~>3.0
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.
TPJStreamWrapper inherits all the methods of TStream. Only new methods and those of TStream that are overridden are described here.
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. |
Method | Description |
---|---|
SetSize | Override. Sets the size of the wrapped stream. |
The sole property is protected.
Property | Description |
---|---|
BaseStream | References the wrapped stream. |
The class defines no events.