Class TStreamAdapter (unit SuperStream)

Inherits from

TStream

TStreamAdapter defines a stream that wraps another stream.

Constructors


constructor Create(targetStream : TStream; owned : Boolean);

Construct a stream adapter.


Functions

destructor Destroy;

Destroy a stream adapter.

function Read(var Buffer; Count: Longint): Longint;

Read count bytes into buffer.

function Seek(Offset: Longint; Origin: Word): Longint;

Move to a given position in the stream.

function Write(const Buffer; Count: Longint): Longint;

write count bytes to the stream.

Properties

Events

Variables


Constructors


constructor Create(targetStream : TStream; owned : Boolean);

ParameterDescription
targetStreamThe stream being adapted.
ownedIf true, the stream being adapted will be destroyed when the adapter is destroyed.

Construct a stream adapter.


Functions


destructor Destroy;

Destroy a stream adapter. Will also destroy the target stream if the owned flag is set true.


function Read(var Buffer; Count: Longint): Longint;

ParameterDescription
bufferVariable to read bytes into.
countNumber of bytes to read.

Read count bytes into buffer. This is an override of the standard stream function.


function Seek(Offset: Longint; Origin: Word): Longint;

ParameterDescription
offsetThe position to move to.
originWhere to move: Can be soFromBeginning, soFromCurrent, or soFromEnd.

Move to a given position in the stream.


function Write(const Buffer; Count: Longint): Longint;

ParameterDescription
bufferVariable to write to the stream.
countNumber of bytes to write.

write count bytes to the stream. This is an override of the standard stream function.


Properties


Events


Variables