Re: Binary file byte ordering



groufosse@xxxxxxx wrote:
Hello:

I have a question that I hope someone experienced with Delphi can
answer...

I am using a program to read a binary file that was written in Delphi.
The data is Delphi's extended
precision type, which is 10 bytes. I need to convert those over to a
double precision number (8 bytes)

Here's the question: exactly how does the Delphi compiler interpret
those 10 bytes? I'll take a step
back....I know that the actual readfile is done by a win32 call
through windows app. So I guess
I have 2 questions:

1 - How are the bytes ordered when they are read in? This is critical
because I am reading
in a byte at a time (as U8)

2 - What is the ordering of the bytes....The endian-ness?

I have an algorithm to convert the byes that constitute the extended
precision to doubles,
but I guess it won't be very useful if I cannot get the byes ordered
correctly!

Thank you for any help!
Regards, Gary.
intel does little Endian..
which means, the first byte in memory is the low part of the item..

being it was done via delphi, I would say it's also read/written that
way to file.


--
"I'd rather have a bottle in front of me than a frontal lobotomy"


http://webpages.charter.net/jamie_5";

.



Relevant Pages

  • Binary file byte ordering
    ... I am using a program to read a binary file that was written in Delphi. ... precision type, which is 10 bytes. ... through windows app. ...
    (alt.comp.lang.borland-delphi)
  • Re: Assigning Variables at runtime?
    ... > I'm a newbie to Delphi, and newsgroups so please be patient. ... > I have a binary file containing blocks of 194 bytes of data. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Copy portions of array
    ... binary file. ... When compiled VB is astonishingly fast at dealing with Byte Arrays, ... discovered this when I wrote a Delphi DLL for sorting large files. ... I gave the DLL an option to CallBack to VB to perform the comparison, ...
    (microsoft.public.vb.general.discussion)
  • Assigning Variables at runtime?
    ... I'm a newbie to Delphi, and newsgroups so please be patient. ... I have a binary file containing blocks of 194 bytes of data. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Binary file byte ordering
    ... I am using a program to read a binary file that was written in Delphi. ... The format is the same as the IEEE format: ... "Computer dating is fine, if you're a computer." ...
    (alt.comp.lang.borland-delphi)