Stream: IIOStream;
The Stream property returns a stream for work with a binary file as a bytes sequence.
Executing this example requires a binary file 1.dat to be present in a root of the disc C.
Sub Main;
Var
File1: IFileInfo;
BinR: IBinaryReader;
IntList: IArrayList;
i: Integer;
Begin
File1:=New FileInfo.Attach("c:\1.dat");
IntList:=New ArrayList.Create;
If File1.Exists Then
BinR:=File1.OpenBinaryReader;
For i:=0 To 255 Do
IntList.Add(BinR.Stream.ReadByte);
End For;
End If;
Dispose File1;
End Sub Main;
After executing this example, 225 bytes are read into the array IntList from the file 1.dat.
See also: