The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



LoadFromStream


Unit:SDL_vector
Class: TVector, TIntVector
Declaration: [1] function LoadFromStream (InStream: TMemoryStream; AdjustVectorSize: boolean): boolean;
[2] function LoadFromStream (InStream: TFileStream; AdjustVectorSize: boolean): boolean;

The function LoadFromStream loads the vector elements which have been stored previously by the method SaveToStream. The parameter InStream specifies the stream to be read from, which may be either a memory stream (version [1]) or a file stream (version [2]). LoadFromStream returns a TRUE value, if the data have been successfully read. If the parameter AdjustVectorSize is set to TRUE, the vector size is adjusted before the data are read in order to be able to hold the entire data. If AdjustVectorSize is FALSE the data will be only read if it fits into the existing vector.

Hint 1: The internal formats of the streams created by TVector and TIntVector are different. Thus a TIntVector cannot load a vector stored my TVector and vice versa.

Hint 2: Reading vector data from a stream always starts at the current stream position. This allows to read several vectors from a single stream.


Last Update: 2023-Feb-06