On Wed, Jun 18, 2008 at 11:48 PM, Markus Spoettl
<[EMAIL PROTECTED]> wrote:
> On Jun 18, 2008, at 2:41 PM, Michael Ash wrote:
>>
>> Although it partially defeats the purpose of using NSCoder, you'll
>> avoid this whole path if you stuff all four doubles into a single
>> NSData. Don't forget to use the byte-swapping functions to ensure that
>> they all have a consistent representation across architectures.
>
> Well, what can I say, you and Quincey Morris are absolutely right. This is
> the way to go.
>
> The same data set takes just 4 seconds to store with a file size of 17.2MB.
>
> Thanks for all the help guys! For the record I'm posting the code below.

I'm glad it all worked out for you.

Just to address one last point, there should be no problems with
floating point formats. As a practical matter, both PPC and x86 use
the same IEEE754 floating point format, so the only problem is
endianness. Any realistic future architecture is also likely to use
this standard format. In a theoretical sense you should be protected
regardless, because the swap functions you're using are explicitly
made for floating point, so if there were any format differences then
they would be expected to take care of them for you.

Mike
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to