[Mono-list] Conversation Problem in BinaryReader.ReadInt16 & BinaryReader.ReadByte

Jenzo trash at jenszo.de
Mon Feb 23 20:09:10 EST 2009


Hi,

I'd like to report a but, however I am not quite sure about it because I am
not yet coding that long in Mono. In addition I am pretty new to
networkcoding. Basicly, the following code does not what I expect it to do:

BinaryReader r = new BinaryReader();
byte[] data = {0,0,1,68};

int cnt=0;
while(cnt<4) {
   data[cnt]=r.ReadByte();
   Console.Write("|{0}",data[cnt++]);
}

Bytestream => Single Output
byte[] data = {0,0,1,68}; => |0|0|0|68
byte[] data = {0,0,1,128}; => |0|0|0|128
...

As you can see, I am missing a "1" regularly. I cant really explain that.
You can follow the Inputstream with Wireshark, so you can be sure about the
source. 
In addition, exactly the same happens if you try to read the stream with
r.ReadInt16. Strange.

Did anyone encounter that kind of problem before? I hope it is not related
to any kind of stupidity :-P

PS: Running OpenSuse 11.1 x86_64 with Mono 2.0.1 from official repositories.

Thanks in advance,
Jenzo
-- 
View this message in context: http://www.nabble.com/Conversation-Problem-in-BinaryReader.ReadInt16---BinaryReader.ReadByte-tp22173682p22173682.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list