IIOStream.Size

Syntax

Size: Integer;

Description

The Size property determines a stream size in bytes.

Example

Sub UserProc;
Var
    File1: IFileInfo;
    BinW: IBinaryWriter;
    Stream: IIOStream;
    i: Integer;
Begin
    File1 := New FileInfo.Attach("c:\1.dat");
    If File1.Exists Then
        BinW := File1.OpenBinaryWriter(True);
        Stream := BinW.Stream;
        For i := 65 To 90 Do
            Stream.WriteByte(i);
        End For;
        i := Stream.Size;
    End If;
    Dispose File1;
End Sub UserProc;

After executing the example the bytes sequence is written into the 1.dat file and the "i" variable contains size of a stream written into the file.

See also:

IIOStream