On 2/16/07, Charles Yeomans <[EMAIL PROTECTED]> wrote:

The best thing would be to be able to pick a representation, say,
little endian, and use it always.  If you have control over reading
and writing of image data, then you should be to do so.


Charles:

this would be easiest, but I suspect not best: if i used say
littleEndian always, then my app running on a bigEndian Mac would
always be forced to either byte-swap a 100 MB file during read/write,
or worse, force the memblocks to byte-swap every m.ushort access
because m would be set to its unnatural littleEndian setting on a
bigEndian machine.  Or am I missing something?

Another surprise I just noticed is that a file written on an Intel
Mac, then opened on a PPC Mac, was able to correctly read
binStream.readLong's even tho the byteorder is different on the 2
machines.  I suspect because bin streams are always written as
bigendian regardless of platform.  My problem arose because I also
directly do:

binStream.Write m.stringValue(0, dataSize)

so this wrote raw data in littleEndian order from the Intel Mac, which
the PPC Mac later assumed was bigEndian.  (but all the writeLong's etc
are always bigendian so there is no confusion, the byte swap occurred
when the file is written from an Intel Mac I assume; my issue is that
byte-swapping a 100 MB block would be a huge performance hit). Do I
understand this right?

I'm surprised others have not run into this problem.

P.



--
-------------------------------------------------------------------------------
Peter K. Stys, MD
Professor of Medicine(Neurology), Senior Scientist
Ottawa Health Research Institute, Div. of Neuroscience
Ottawa Hospital / University of Ottawa
Ontario, CANADA
tel:    (613)761-5444
fax:    (613)761-5330
http://www.ohri.ca/profiles/stys.asp
-------------------------------------------------------------------------------
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to