Google
CommonTypes.SaveDynamicArrayToStream Function
Namespace
Pascal
procedure SaveDynamicArrayToStream(const DynArray: Pointer; const DimCount: Integer; const ElementSize: Integer; const Stream: TStream);
File
Description

This procedure saves a multi-dimensional dynamic array of any simple, fixed- length data type to a stream. 

Warning: Do not use this if the array contains pointers, interfaces, objects, or strings. Fixed-length records should be fine. 

Possible improvement: storing DimCount and ElementSize in the stream (before the array data) would remove the need for two arguments in the counterpart load procedure. 

Possible improvement: passing a pointer to a custom single-element read/write procedure could allow working with variable-length and reference-counted data types.

Related Information