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