I have source code available for a legacy Delphi application that creates/reads a binary file. I have to read that binary file in a C# application.
The code in Delphi is something like this :
fs := TFileStream.Create(dst,fmOpenRead);
try
while fs.Position<fs.Size do begin
fs.Read(sSomeVar,sizeof(dDateTime));
fs.Read(sSomeVar1,sizeof(sIntValue));
fs.Read(sSomeVar2,sizeof(sCardinalValue1));
fs.Read(sSomeVar3,sizeof(sStringValue));
....
It appears that I have read the entire file into a byte[] and then interpret number of bytes to correct data type(for e.g. integer, string, uint1)?
I couldn't find a c# example anywhere.
Thanks,