Skip to content

TStreamReader

Implement TTextReader for streams.

Declaration

Source position: streamex.pp line 110

type

  TStreamReader = class(TTextReader)
  public
    constructor Create(AStream: TStream; ABufferSize: Integer; 
                  AOwnsStream: Boolean);
    constructor Create(AStream: TStream);
    constructor Create(const aFilename: string);
    constructor Create(const aFilename: string; aDetectBOM: Boolean);
    constructor Create(const aFilename: string; aEncoding: TEncoding; 
                  aDetectBOM: Boolean; aBufferSize: Integer); overload;
    destructor Destroy;
    procedure Reset;
    procedure Close;
    procedure ReadLine; overload;
    property BaseStream: TStream; {r}
    property OwnsStream: Boolean; {rw}
  end;

Description

TStreamReader is a TTextReader descendent that takes a stream as the source of text data. It can free the stream and the buffer size to use for reading data can be set.

Properties

Member Visibility Description
BaseStream read only public The stream with the text data.
OwnsStream public Should the stream be freed on close.
See all Properties

Methods

Member Visibility Description
Close public Close and possibly free the stream.
Create public Create a new instance of TStreamReader from a stream.
Destroy public Destroy the TStreamReader instance.
ReadLine public Read a line of text.
Reset public Reset the stream to its original position.
See all Methods

See also

Name Description
TTextReader Text reader class.