2
Reply

converting single to an array of double

latika singh

latika singh

Feb 16 2012 11:47 AM
1.7k
Dear All,

I have created an application to transfer data on a UDP protocol as an asynchronous client socket. I am receiving 32 bytes of data on UDP in variable db.buffer.

db is an instance of a class and buffer is byte array.

I am executing the following statement:
Dim value As Double = BitConverter.ToSingle(db.buffer, 0)

after executing the statement the length of the value is converted to only single instead I want it to store as an array so that I can read all the bytes respectively. Is there a way to overcome this situation? How can I split the bytes and store them in an array of double or integer?

Answers (2)