[Overview][Constants][Types][Classes][Procedures and functions][Variables] |
Initialize memory stream, reserves memory for stream data.
Source position: objects.pp line 372
constructor TMemoryStream.Init( |
ALimit: LongInt; |
ABlockSize: Word |
); |
Initinstantiates a new TMemoryStreamobject. The memorystreamobject will initially allocate at least ALimitbytes memory, divided into memory blocks of size ABlockSize. The number of blocks needed to get to ALimitbytes is rounded up.
By default, the number of blocks is 1, and the size of a block is 8192. This is selected if you specify 0 as the blocksize.
For an example, see e.g TStream.CopyFrom.
If the stream cannot allocate the initial memory needed for the memory blocks, then the stream's status is set to stInitError.
|
Clean up memory and destroy the object instance. |