string inputString = "".PadRight(1000, 'z');
byte[] inputBytes = Encoding.UTF8.GetBytes(inputString);
#if SILVERLIGHT
IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();
#else
IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForDomain();
#endif
//Create the input file
string inputFilePath = "InputFile.txt";
using (IsolatedStorageFileStream outputStream = new IsolatedStorageFileStream(inputFilePath, FileMode.Create, FileAccess.Write, FileShare.None, store))
{
outputStream.Write(inputBytes,0,inputBytes.Length);
}
//Compress it
string compressedPath = "Compressed.txt";
Compression compression = new Compression(store);
compression.CompressFile(inputFilePath,compressedPath);
//Decompress
string uncompressedPath = "Uncompressed.txt";
compression.DecompressFile(compressedPath,uncompressedPath);