Skip to content

TNullStream

Empty data stream.

Declaration

Source position: nullstream.pp line 36

type

  TNullStream = class(THandleStream)
  public
    function Read : LongInt;
    function Write : LongInt;
    function Seek : Int64;
    constructor Create;
  end;

Description

TNullStream discards any data written to it (but keeps a virtual size) and returns 0 bytes when read from. It emulates a #rtl.classes.TMemoryStream: When writing to the stream, the size is increased as needed. When reading, the maximum number of returned bytes is limited to the size of the stream.

Methods

Member Visibility Description
Create public Create a new instance.
Read public Read null bytes from the stream.
Seek public Set current position in the stream.
Write public Write to stream.
See all Methods

See also

Name Description
TNullStream.Read Read null bytes from the stream.
TNullStream.Write Write to stream.
#rtl.classes.TStream.Size