critical bug in streams.
Sebastien Senechal
seb at cyberdine.ca
Tue Oct 17 17:17:23 PDT 2006
That makes senses... i have been confused by format and my test variables
which hinted me in wrong direction.
and wasn't expecting a little endian by default ...
well thanks to you and Armel for your fast answers :)
Le mardi octobre 17 2006 17:15, Chris Wilson a écrit :
> Hi Sebastien,
>
> On Tue, 17 Oct 2006, Sebastien Senechal wrote:
> > wxUint16 var1 = 1;
> > wxUint8 var2 = 2;
> > wxUint64 var3 = 3;
> > wxUint32 var4 = 4;
> > wxUint64 var5 = 5;
> > wxUint16 var6 = 6;
> >
> > m_outputStream << var1 << var2 << var3 << var4 << var5 << var6 ;
> >
> > gives
> > < 00000000 01 00 02 03 00 00 00 00 00 00 00 04 00 00 00 05 #
> > ................ < 00000010 00 00 00 00 00 00 00 06 00 00 00 00 00
> > # .............
> >
> > It seems a given variable is encoded with the previous variable type
> > !!!!!
>
> Are you sure? Looking at this byte stream, one could just aswell say that
> it is in little endian order (lowest byte first), and
>
> 01 00 => var1
> 02 => var2
> 03 00 00 00 00 00 00 00 => var3
> 04 00 00 00 => var4
>
> etc.
>
> I haven't used wxDataOutputStream or checked the code, so I can't be sure
> of this. But it makes sense to me.
>
> Cheers, Chris.
--
Sébastien Sénéchal
Cyberdine
4685, de Lorimier
Montreal, QC, H2H-2B4
tel: (514) 998-8101
More information about the wx-users
mailing list