欢迎访问本站!今天是:
您现在所在的位置:欢乐棋牌 > 欢乐棋牌 > 重要通知 >

真人可以提现棋牌游戏返回Base64编码字符 /// /summary /// param name=rawString

2019-09-03 [文号]: 来源:keraon 浏览次数:

bytesRead); } compressedzipStream.Close(); return outBuffer.ToArray(); } ,欢乐99棋牌下载, 0,欢乐棋牌, using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.IO.Compression; using System.Data; namespace Lis2013HISWSTest { public class ZipHelper { /// summary /// 解压 /// /summary /// param name=Value/param /// returns/returns public static DataSet GetDatasetByString(string Value) { DataSet ds = new DataSet(); string CC = GZipDecompressString(Value); System.IO.StringReader Sr = new StringReader(CC); ds.ReadXml(Sr); return ds; } /// summary /// 根据DATASET压缩字符串 /// /summary /// param name=ds/param /// returns/returns public static string GetStringByDataset(string ds) { return GZipCompressString(ds); } /// summary /// 将传入字符串以GZip算法压缩后, CompressionMode.Compress, 0, CompressionMode.Decompress); MemoryStream outBuffer = new MemoryStream(); byte[] block = new byte[1024]; while (true) { int bytesRead = compressedzipStream.Read(block,欢乐棋牌, 0, true); compressedzipStream.Write(rawData,欢乐棋牌, rawData.Length); compressedzipStream.Close(); return ms.ToArray(); } /// summary /// 将传入的二进制字符串资料以GZip算法解压缩 /// /summary /// param name=zippedString经GZip压缩后的二进制字符串/param /// returns原始未压缩字符串/returns public static string GZipDecompressString(string zippedString) { if (string.IsNullOrEmpty(zippedString) || zippedString.Length == 0) { return ; } else { byte[] zippedData = Convert.FromBase64String(zippedString.ToString()); return (string)(System.Text.Encoding.UTF8.GetString(Decompress(zippedData))); } } /// summary /// ZIP解压 /// /summary /// param name=zippedData/param /// returns/returns public static byte[] Decompress(byte[] zippedData) { MemoryStream ms = new MemoryStream(zippedData); GZipStream compressedzipStream = new GZipStream(ms,返回Base64编码字符 /// /summary /// param name=rawString须要压缩的字符串/param /// returns压缩后的Base64编码的字符串/returns public static string GZipCompressString(string rawString) { if (string.IsNullOrEmpty(rawString) || rawString.Length == 0) { return ; } else { byte[] rawData = System.Text.Encoding.UTF8.GetBytes(rawString.ToString()); byte[] zippedData = Compress(rawData); return (string)(Convert.ToBase64String(zippedData)); } } /// summary /// GZip压缩 /// /summary /// param name=rawData/param /// returns/returns public static byte[] Compress(byte[] rawData) { MemoryStream ms = new MemoryStream(); GZipStream compressedzipStream = new GZipStream(ms, block.Length); if (bytesRead = 0) break; else outBuffer.Write(block。

分享到: