byte []到任何数组 [英] byte[] to any array
本文介绍了byte []到任何数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将代码中的ui转换为List< int> ;?
How can I convert ui in the code to List<int>?
List<int> b; = new List<int>();
MemoryStream c = new MemoryStream();
BinaryFormatter g = new BinaryFormatter();
g.Serialize(c,b);
byte[] ui= c.ToArray();
推荐答案
尝试一下即可还使用byte []代替List< byte>.希望对您有帮助
Try this you can also use byte[] instead of List<byte>. Hope it helps
BinaryFormatter bf = new BinaryFormatter();
using(Stream ms = new MemoryStream(bytes)) {
List<byte> myList = (List<byte>)bf.Deserialize(ms);
}
答案参考 HERE [
Answer reference HERE[^]
这篇关于byte []到任何数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文