TMemoryStream

[Properties (by Name)][Methods (by Name)][Events (by Name)]

Stream which keeps data in memory.

Declaration

Source position: objects.pp line 401

Type
  TMemoryStream = object (TStream)
    BlkCount : LongInt;
    BlkSize : Word;
    MemSize : LongInt;
    BlkList : PPointerArray;
    constructor Init(ALimit: LongInt; ABlockSize: Word);
    destructor Done;  Virtual;
    procedure Truncate;  Virtual;
    procedure Read(var Buf; Count: LongInt);  Virtual;
    procedure Write(var Buf; Count: LongInt);  Virtual;
  private
    function ChangeListSize(ALimit: LongInt) : Boolean;
  end
  ;

Description

The TMemoryStream object implements a stream that stores it's data in memory. The data is stored on the heap, with the possibility to specify the maximum amount of data, and the size of the memory blocks being used.

Members

Member Type Visibility Description
BlkCount Field default Number of allocated memory blocks
BlkList Field default Pointer to list of allocated blocks.
BlkSize Field default Size of one memory block
ChangeListSize Method private
Done Method default Clean up memory and destroy the object instance.
Init Method default Initialize memory stream, reserves memory for stream data.
MemSize Field default Total memory size
Read Method default Read data from the stream to a location in memory.
Truncate Method default Set the stream size to the current position.
Write Method default Write data to the stream.

Inheritance

Class Description
TMemoryStream Stream which keeps data in memory.

See also

Name Description
LongInt A signed 32-bits integer
LongInt A signed 32-bits integer
TPointerArray Array with maximum allowed number of pointers
TStream Base stream class
Word An unsigned 16-bits integer