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