Could somebody tell me how can I convert byte[] to ArrayList by using C# under Windows Mobile?
Later edit:
this would go like having an ArrayList containing instances of a custom type. This list goes to a database (into a blob) as a byte array (the conversion is done by the database API); What I want is to revert the byte[] to ArrayList;
.NET CF does not provide the BinaryFormatter;
All arrays inherit off ICollection, so you can just use
ArrayList list = new ArrayList(bytearray);
although I would use the generic List<byte> myself using the same method, as that prevents boxing of each byte value in the array. Although arrays don't staticly inherit off the generic IList for the respective type, the CLR adds relevant implementations to each array instance at runtime (see the Important Note here)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With