Esempio n. 1
0
        public static byte[] Compress(byte[] Input)
        {
            MemoryStream OutPut = new MemoryStream();
            ZOutputStream ZStream = new ZOutputStream(OutPut,zlibConst.Z_DEFAULT_COMPRESSION);
            Process(ZStream,Input);

            return OutPut.ToArray();
        }
Esempio n. 2
0
        public static byte[] Decompress(byte[] Input)
        {
            MemoryStream OutPut = new MemoryStream();
            ZOutputStream ZStream = new ZOutputStream(OutPut);
            ZStream.FlushMode = zlibConst.Z_SYNC_FLUSH;
            Process(ZStream,Input);

            return OutPut.ToArray();
        }
Esempio n. 3
0
 static private void Process(ZOutputStream ZStream, byte[] Input)
 {
     try
     {
         ZStream.Write(Input, 0, Input.Length);
         ZStream.Flush();
         ZStream.Close();
     }
     catch (Exception e)
     {
         Console.WriteLine("Zlib Process Error : " + e.ToString());
     }
 }
Esempio n. 4
0
 private static void Process(ZOutputStream ZStream,byte[] Input)
 {
     try
     {
         ZStream.Write(Input, 0, Input.Length);
         ZStream.Flush();
         ZStream.Close();
     }
     catch (Exception e)
     {
         Console.WriteLine("Zlib Process Error : " + e.ToString());
     }
 }