public static string CompressGraphData(string input) { byte[] encoded = System.Text.Encoding.UTF8.GetBytes(input); byte[] compressed = GzipCompression.Compress(encoded); return(Convert.ToBase64String(compressed)); }
public static string DecompressGraphData(string input) { byte[] compressed = Convert.FromBase64String(input); byte[] decompressed = GzipCompression.Decompress(compressed); return(System.Text.Encoding.UTF8.GetString(decompressed)); }