C
Craig Klinker
I am having an issue trying to use a binary reader. In the following case I
would like to have the value 66 and 3 returned respectivly but I am getting
large number since the reader is reading in littleendian format.
Here is my code
Dim Buffer() As Byte = New Byte() {&H0, &H0, &H0, &H42, &H0,
&H0, &H0, &H3}
Dim ms As New IO.MemoryStream(Buffer)
Dim br As New IO.BinaryReader(ms,
Text.Encoding.BigEndianUnicode)
Console.WriteLine("Message Length = " & br.ReadInt32())
Console.WriteLine("Message Type = " & br.ReadInt32())
This generates
Message Length = 1107296256
Message Type = 50331648
Does anyone know of an easy way to accomplish this or so I have to write my
own encoder?
Thanks
Craig J. Klinker
IntraNext Systems
would like to have the value 66 and 3 returned respectivly but I am getting
large number since the reader is reading in littleendian format.
Here is my code
Dim Buffer() As Byte = New Byte() {&H0, &H0, &H0, &H42, &H0,
&H0, &H0, &H3}
Dim ms As New IO.MemoryStream(Buffer)
Dim br As New IO.BinaryReader(ms,
Text.Encoding.BigEndianUnicode)
Console.WriteLine("Message Length = " & br.ReadInt32())
Console.WriteLine("Message Type = " & br.ReadInt32())
This generates
Message Length = 1107296256
Message Type = 50331648
Does anyone know of an easy way to accomplish this or so I have to write my
own encoder?
Thanks
Craig J. Klinker
IntraNext Systems