Click here to Skip to main content
15,903,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I convert ui in the code to List<int>?

C#
List<int> b; = new List<int>();
MemoryStream    c = new MemoryStream();
BinaryFormatter g = new BinaryFormatter();
g.Serialize(c,b);
          
byte[] ui= c.ToArray();
Posted
Updated 19-Jan-11 23:45pm
v3

1 solution

Try this you can also use byte[] instead of List<byte>. Hope it helps

C#
BinaryFormatter bf = new BinaryFormatter();
using(Stream ms = new MemoryStream(bytes)) {
    List<byte> myList = (List<byte>)bf.Deserialize(ms);
}


Answer reference HERE[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900