WARNING: This code has been only lightly tested on big-endian platforms! It is known to work well on little-endian platforms that have a small penalty for unaligned reads, such as current Intel and AMD moderate-to-high-end CPUs. It should work on all 32-bit and 64-bit platforms that allow unaligned reads; bug reports are welcome.