[Q] Reading little endian DOUBLES on big endian platforms

Andreas Raab andreas.raab at gmx.de
Fri Dec 3 09:05:39 UTC 2004


No trick. The method doesn't exist. If you need it you'll have to write your 
own.

Cheers,
  - Andreas

----- Original Message ----- 
From: "Baveco, Hans" <Hans.Baveco at wur.nl>
To: "The general-purpose Squeak developers list" 
<squeak-dev at lists.squeakfoundation.org>
Sent: Friday, December 03, 2004 9:39 AM
Subject: [Q] Reading little endian DOUBLES on big endian platforms


In my Shapes package I make extensive use of the ByteArray>>doubleAt: method 
(in the *FFI category), to read little-endian DOUBLES from the contents of a 
binary file stream. This #doubleAt: is part of the FFIPlugin, and maybe not 
a good general thing to rely on (can it be absent in some Squeak 
distributions)? On windows it works fine, but on Mac not (of course). There 
doesn't seem to be a doubleAt:bigEndian: method available that allows me to 
define the endianness, like there is for integers (longAt:bigEndian: & 
shortAt:bigEndian:).

What is the trick here?

Hans






More information about the Squeak-dev mailing list