Stream: IIOStream;
The Stream property returns the stream for work 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 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 the example 225 bytes are read into the IntList array from the 1.dat file.
See also: