Skip to content

TWindowedStream

Provide a window on another stream.

Declaration

Source position: streamex.pp line 310

type

  TWindowedStream = class(TOwnerStream)
  public
    constructor Create;
    destructor Destroy;
    function Read : LongInt;
    function Write : LongInt;
    function Seek : Int64;
  end;

Description

TWindowedStream is a TStream descendent that can be used to provide a window on the data of another stream. The position and size of the window can be determined in the constructor, and the stream will behave as a normal stream. The actual reading (or writing) will happen on the source stream.

If the source stream has some limitations (e.g. no Seek) then the TWindowedStream will inherit these limitations.

The TWindowedStream will keep track of the last position it used, and will attempt to restore it if it was modified between calls to Read and Write.

Methods

Member Visibility Description
Create public Initialize a new instance of TWindowedStream.
Destroy public Destroy the TWindowedStream instance.
Read public Read data from the stream.
Seek public Reposition the stream.
Write public Read data to the stream.
See all Methods

See also

Name Description
TStream
TWindowedStream.Create Initialize a new instance of TWindowedStream.