Stream: IIOStream;
The Stream property returns the stream for working with a binary file as a bytes sequence.
Executing the example requires the 1.dat binary file to be present in the root of the disc C.
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;
End If;
Dispose File1;
End Sub UserProc;
After executing the example a bytes sequence is written to the 1.dat file.
See also: