• 压缩和解压缩的方法 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;
            }

    下电影就上 挖沙啦电影网 - 更多免费高清电影下载
  • 相关阅读:
    Officer Anany Collecting String Subsequences(ECPC2019)
    P3530 [POI2012]FESFestival
    L3011 直捣黄龙 (天梯赛)
    树与图上的计数专题
    P4657 [CEOI2017]Chase
    Steadily Growing Steam
    图论复习
    Tree Infection(CF)
    推导部分和(蓝桥杯)
    Baby Ehab's Whining Chance
  • 原文地址:https://www.cnblogs.com/zzmzaizai/p/1338084.html
Copyright © 2020-2023  润新知