RAD Studio VCL Reference
TMemoryStream.SetSize Method

Sets the Size property of the memory stream.

procedure SetSize(NewSize: Longint); override;
virtual __fastcall SetSize(Longint NewSize);

Use SetSize to set the Size of a memory stream before filling it with data. SetSize allocates the memory buffer to hold NewSize bytes, preserving as much of the existing data as possible. 

Use SetSize before filling the memory buffer with data from various sources, or from a portion of another stream. If the intended contents of the memory stream is exactly the same as the contents of another stream or file, use LoadFromStream or LoadFromFile instead. 


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!