I want to store data in bytes. But as I'm new to Windows Phone 8; I don't know how to do it.
Any kind of help will be appreciated.. thanks
I want to store data in bytes. But as I'm new to Windows Phone 8; I don't know how to do it.
Any kind of help will be appreciated.. thanks
DataContractSerializer serializer = new DataContractSerializer(typeof(List<Dictionary<String, String>>));
byte[] byteArr;
using (var ms = new System.IO.MemoryStream())
{
serializer.WriteObject(ms, stringlist);
byteArr = ms.ToArray();
}
return byteArr;
System.Runtime.Serialization.DataContractSerializer serializer = new System.Runtime.Serialization.DataContractSerializer(typeof(List<Dictionary<String, String>>));
List<Dictionary<String, String>> stringlist;
using (var ms = new System.IO.MemoryStream(byteArr))
{
stringlist = (List<Dictionary<String, String>>)serializer.ReadObject(ms);
}
return stringlist;
This code is helpful to get your data back to original state. I think this is what you are asking for