this should make the decoder safe for big-endian platforms