[Haskell-cafe] Endian conversion
Udo Stenzel
u.stenzel at web.de
Mon Oct 3 15:33:11 EDT 2005
Joel Reymont wrote:
> Are there any endian conversion routines for Haskell? I'm looking to
> build binary packets on top of NewBinary.Binary but my data is coming
> in little-endian whereas I'll need to send it out big endian.
Why don't you pull out 4 bytes and assemble them manually? Three
shifts, logical ors and fromIntegrals aren't that much of a burden after
all.
Udo.
--
The Second Law of Thermodynamics:
If you think things are in a mess now, just wait!
-- Jim Warner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org//pipermail/haskell-cafe/attachments/20051003/4f4e094d/attachment.bin
More information about the Haskell-Cafe
mailing list