My data have nothing to do with strings - it's all raw binary image
data, so UTF-8 etc.  does not enter into the equation.

Aha. So this is a different problem then because your file format is probably always supposed to be in big endian?

I say... just make a byte swap function. It's really easy. Then make a function that will swap the bytes upon read, but only if the platform is correct.

function SwapImageBytes(mb as memoryblock)
#if TargetBigEndian = false then
dim i, char, n as integer
n = mb.size - 1
for i = 0 to n step 2
char = mb.bytevalue(i)
mb.bytevalue(i) = mb.bytevalue(i+1)
mb.bytevalue(i+1) = char
next
#endif
end function

there you go :)

This is cool, because then you can do all your processing without setting .littleendian to true, which is to be honest, a slow thing to do.
_______________________________________________
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