[Q] Reading little endian DOUBLES on big endian platforms

Baveco, Hans Hans.Baveco at wur.nl
Fri Dec 3 08:39:47 UTC 2004


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