开发者

Convert generic list of double to byte array in VB.NET?

开发者 https://www.devze.com 2023-04-02 01:24 出处:网络
I am trying to figure this one out. I saw a link on how to convert a list of ints to a byte array in C#, b开发者_如何学Cut I can\'t get syntax to work out for me in VB.NET.

I am trying to figure this one out. I saw a link on how to convert a list of ints to a byte array in C#, b开发者_如何学Cut I can't get syntax to work out for me in VB.NET.

Stack Overflow question Converting a list of ints to a byte array.


You just need to use the same function, but pass in a double value rather than an integer value.

Dim doubles as New List(Of Double)

doubles.Add(3.14)
doubles.Add(2.614)

Dim bytes() as Byte
bytes = doubles.SelectMany(Function(d) BitConverter.GetBytes(d)).ToArray()
0

精彩评论

暂无评论...
验证码 换一张
取 消