- buf[0] = i & 0xff;
- buf[1] = (i >> 8) & 0xff;
- buf[2] = (i >> 16) & 0xff;
- buf[3] = (i >> 24) & 0xff;
- m_output->Write(buf, 4);
+ if (m_be_order)
+ i32 = wxUINT32_SWAP_ON_LE(i);
+ else
+ i32 = wxUINT32_SWAP_ON_BE(i);
+ m_output->Write(&i32, 4);