Vector.WriteHeader Method

Overload List

#SignatureDescription
1procedure WriteHeader(const Dst: TStream); overload;
2procedure WriteHeader(const Dst: TStream; Precision: TPrecision; Rounding: TRounding = rnTrunc); overload;Writes the header information for the calling vector to a stream.

Overload 1: procedure WriteHeader(const Dst: TStream); overload;

#NameTypeDescription
1DstTStream

Result: stored in self (calling object)

Overload 2: procedure WriteHeader(const Dst: TStream; Precision: TPrecision; Rounding: TRounding = rnTrunc); overload;

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

#NameTypeDescription
1DstTStream
2PrecisionTPrecision
3RoundingTRounding

Result: stored in self (calling object)

Remarks:

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.

Examples
var b: Vector;
    AStream: TFileStream;
begin
    b := [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;
    end;
end;
See Also: Vector.ReadHeader, Vector.WriteValues, Vector.WriteValues