T
TF
Hi,
I've a byte array with 4 elements in BigEndian format i.e. {0, 0, 0,
12} and i want to convert it to 4-byte integer (Int32). I am trying
Encoding.BigEndianUnicode property but it has no effect on the result.
It always gives me number '201326592' instead of '12'.
Any help??
Here is the code:
Dim a_byte() As Byte = New Byte() {0, 0, 0, 12}
Dim ms As New MemoryStream(a_byte)
Dim br As New BinaryReader(ms, Encoding.BigEndianUnicode)
Dim x As Int32 = br.ReadInt32() ' expecting x = 12
br.Close()
ms.Close()
I've a byte array with 4 elements in BigEndian format i.e. {0, 0, 0,
12} and i want to convert it to 4-byte integer (Int32). I am trying
Encoding.BigEndianUnicode property but it has no effect on the result.
It always gives me number '201326592' instead of '12'.
Any help??
Here is the code:
Dim a_byte() As Byte = New Byte() {0, 0, 0, 12}
Dim ms As New MemoryStream(a_byte)
Dim br As New BinaryReader(ms, Encoding.BigEndianUnicode)
Dim x As Int32 = br.ReadInt32() ' expecting x = 12
br.Close()
ms.Close()