1 //大端格式,高字节在前 2 QDataStream out(&outData,QIODevice::ReadWrite); 3 out.setByteOrder(QDataStream::BigEndian); 4 5 6 //小端格式,低字节在前 7 QDataStream out(&outData,QIODevice::ReadWrite); 8 out.setByteOrder(QDataStream::LittleEndian);