Exemplo n.º 1
0
 public bool Decompress()
 {
     lock (this.locker)
     {
         if (this.IsCompressed)
         {
             this.Snapshot     = CompressHelper.UnzipFromBase64String(this.Snapshot);
             this.IsCompressed = false;
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 2
0
 public bool Compress()
 {
     lock (this.locker)
     {
         if (!this.IsCompressed)
         {
             this.Snapshot     = CompressHelper.ZipToBase64String(this.Snapshot);
             this.IsCompressed = true;
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 3
0
 public static string UnzipFromBase64String(string base64Str)
 {
     return(CompressHelper.Unzip(Convert.FromBase64String(base64Str)));
 }
Exemplo n.º 4
0
 public static string ZipToBase64String(string str)
 {
     return(Convert.ToBase64String(CompressHelper.Zip(str)));
 }