• 压缩和解压缩的方法 from Byte[]


      public static byte[] Zip(byte[] data)
            {
                MemoryStream mstream = new MemoryStream();
                BZip2OutputStream zipOutStream = new BZip2OutputStream(mstream);
                zipOutStream.Write(data, 0, data.Length);
                zipOutStream.Finalize();
                zipOutStream.Close();

                byte[] result = mstream.ToArray();
                mstream.Close();

                return result;
            }

            public static byte[] Unzip(byte[] data)
            {
                MemoryStream mstream = new MemoryStream(data);
                BZip2InputStream zipInputStream = new BZip2InputStream(mstream);
                byte[] byteUncompressed = new byte[zipInputStream.Length];
                zipInputStream.Read(byteUncompressed, 0, (int)byteUncompressed.Length);

                zipInputStream.Close();
                mstream.Close();

                return byteUncompressed;
            }

    下电影就上 挖沙啦电影网 - 更多免费高清电影下载
  • 相关阅读:
    揭开HTTPS神秘面纱
    HTTP常见状态码
    js常用小代码
    通俗讲解OSI七层模型
    WSCDL所在的协议栈位置
    Models and Verification of BPEL
    mysql root密码修改
    c++ Socket 学习笔记一
    mysql备份
    圣杯布局
  • 原文地址:https://www.cnblogs.com/zzmzaizai/p/1338084.html
Copyright © 2020-2023  润新知