You are here: Symbol Reference > AbstractMtxVec Namespace > Classes > TMtxVec Class > public > WriteHeader Method > TMtxVec.WriteHeader Method (TStream, TPrecision, TRounding, TEndianness)
MtxVec VCL
ContentsIndex
PreviousUpNext
TMtxVec.WriteHeader Method (TStream, TPrecision, TRounding, TEndianness)

Writes the header information for the calling vector to a stream.

Pascal
procedure WriteHeader(const Dst: TStream; Precision: TPrecision; Rounding: TRounding = rnTrunc; Endian: TEndianness = MtxSystemEndianness); virtual; overload;

Writes the header information for the calling object to a DstStream stream. The header information contains information about object (size, complex, type of values in Values array, ...) which all define the state of the object. Number type is defined by the Precision parameter. Rounding defines the rounding for integer types. When saving double precision as single precision, all overflows are saved as INF (-INF). When saving to integer types all overflows are clipped. Attempt to save single precision as double precision will raise an exception. The data format uses VersionControl to insure backward compatibilty for future versions of MtxVec.

var b: TVec; AStream: TFileStream; begin CreateIt(b); b.SetIt(False,[0,0,1,3,2]); AStream := TFileStream.Create('C:test.bin',fmCreate); try b.WriteHeader(AStream); // Write info for b b.WriteValues(AStream); // Write values of b finally AStream.Free; FreeIt(b); end; end;
Examples on GitHub
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!