ReadListBegin;
The ReadListBegin method reads an indicator of a page start from a binary file.
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;
Begin
File1:=New FileInfo.Attach("c:\1.dat");
IntList:=New ArrayList.Create;
If File1.Exists Then
BinR:=File1.OpenBinaryReader;
BinR.ReadListBegin;
While Not BinR.EndOfList Do
IntList.Add(BinR.ReadInteger);
End While;
BinR.ReadListEnd;
End If;
Dispose File1;
End Sub Main;
After executing the example integer values from the 1.dat file are read into the IntList array. An indicator of the page beginning is read before reading an array.
See also: