I have some bytes written to a file in isolated storage in my Silverlight application. This file is named “data.dat”. I wrote it to Isolated Storage using the following code:
// Store the data in isolated storage
var bytes = GetData();
using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
{
using (IsolatedStorageFileStream file = new IsolatedStorageFileStream("data.dat", FileMode.Create, storage))
{
file.Write(bytes, 0, bytes.Length);
}
}
My question is, how do I retrieve the bytes from isolated storage once they’re there? Everything I see returns a string. But I don’t see a way to return binary data.
Thanks.
This piece of code will retrieve the bytes –